|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: selecting with text nodes
Hi Ian,
> I want to select only the major recommendations that are not
> completed
First select all the recommendations:
recommendation
Then filter that node set with a predicate. The predicate needs to be
true if the section element child of the recommendation has the value
'major':
section = 'major'
and the completed element child of the recommendation has the value
'yes':
completed = 'yes'
to give:
recommendation[section = 'major' and completed = 'yes']
It looks as though you want to filter the content of the
recommendation a bit, to remove the completed child element, so you
could simply apply templates to the recommendation elements:
<xsl:apply-templates
select="recommendation[section = 'major' and
completed = 'yes']" />
and have a template that does what you want with them:
<xsl:template match="recommendation">
<recommendation>
<xsl:copy-of select="section | para" />
</recommendation>
</xsl:template>
> All the examples I can find are based on attributes.
Selecting child elements is just like selecting attributes, except
that you use the child axis rather than the attribute axis (leave off
the '@'). The value of an element is its textual content.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








