[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xpath question

Subject: Re: xpath question
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 24 Jan 2007 16:45:14 GMT
Re:  xpath question
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.