xsl-list
[Top] [All Lists]

Re: [xsl] xpath question

2007-01-24 09:45:34

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>