Subject: Re: [xsl] xpath question From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 24 Jan 2007 16:45:14 GMT |
since your xsl:otherwise is empty you can use xsl:if rether than xsl:choose (but that is cosmetic) <xsl:value-of select="node()"/> do you really want to do that? node() selects all the child nodes of list1, but (in xsl1) value-of will discard all but the first one (which will be the white space used for indentation unless you have used xsl;strip-space, in which case it is the text element. then (if it does select the text element) it outputs all the character data of that element (not just the scene) ignoring any markup. If you know your scenes are allways at that level you can use what I suggested last time test="text/para/scene[set1=$set1 and set2=$set2]"> which avoids searching under list2, or if they can be at different levels you can use the test I suggested in teh first reply test=".//scene[not(ancestor::list2)]" but if all teh text you want to output is under scene ther is no need to first test if it is there and then process it, just process the scenes that match teh condition, then automatically nothing will happen if there is no match. ie <xsl:template match="list1"> <xsl:apply-templates select="text/para/scene[set1=$set1 and set2=$set2]"/> </xsl:template> <xsl:tempalte match="scene"> set1: <xsl:value-of select="set1"/> set2: <xsl:value-of select="set2"/> </xsl:template> David
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xpath question, xslt . new | Thread | [xsl] xslt (multi) threading or par, Peter Rushforth |
Re: [xsl] xpath question, xslt . new | Date | Re: [xsl] XSLT 2.0 has arrived, Mulberry Technologie |
Month |