A
anywherenotes
Hi,
I currently have the following xsl file:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslutput method="text" omit-xml-declaration="yes" indent="no"/>
<xslaram name="user" select = "''"/>
<xsl:template match="query">
<xsl:choose>
<xsl:when test="exception[name and contains(user,
$user)]">status="exception" user="<xsl:value-of select="user"/>"
exception="<xsl:value-of select="exception/name"/>"</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
And this is the XML file:
<queries>
<query id="123" chunk="0" desc="">
<user>something</user>
<exception>
<name>bob</name>
<description>some error</description>
<time>2007-07-25 15:01:54</time>
</exception>
</query>
<query id="456" chunk="0" desc="">
<user>something else</user>
</query>
</queries>
And my output is:
$ c:/axssrvr_380/bin/xsltproc sample.xsl sample.xml
status="exception" user="something" exception="bob"
$
I'd like to get this:
$ c:/axssrvr_380/bin/xsltproc sample.xsl sample.xml
status="exception" user="something" exception="bob"
$
I'm not clear where the blank lines are coming from, if I pipe output
into 'wc', I get 3 lines, so it's not a long line that's wrapping
around, but rather 3 lines, where I would only expect to get 1.
Thank you.
Alex
I currently have the following xsl file:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslutput method="text" omit-xml-declaration="yes" indent="no"/>
<xslaram name="user" select = "''"/>
<xsl:template match="query">
<xsl:choose>
<xsl:when test="exception[name and contains(user,
$user)]">status="exception" user="<xsl:value-of select="user"/>"
exception="<xsl:value-of select="exception/name"/>"</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
And this is the XML file:
<queries>
<query id="123" chunk="0" desc="">
<user>something</user>
<exception>
<name>bob</name>
<description>some error</description>
<time>2007-07-25 15:01:54</time>
</exception>
</query>
<query id="456" chunk="0" desc="">
<user>something else</user>
</query>
</queries>
And my output is:
$ c:/axssrvr_380/bin/xsltproc sample.xsl sample.xml
status="exception" user="something" exception="bob"
$
I'd like to get this:
$ c:/axssrvr_380/bin/xsltproc sample.xsl sample.xml
status="exception" user="something" exception="bob"
$
I'm not clear where the blank lines are coming from, if I pipe output
into 'wc', I get 3 lines, so it's not a long line that's wrapping
around, but rather 3 lines, where I would only expect to get 1.
Thank you.
Alex