|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] negate predicate
I want to select the text of all descendants of a node which *don't*
have an attribute called 'id' (and none of the nodes which are
descendants of nodes with id attributes).
So that, from the following document snipet:
<document>
<section id="first">
<p>Hello, foo bar</p>
<subsection id="bar">
<p>Some stuff</p>
</subsection>
<subsection id="foo">
<p>Some other stuff</p>
</subsection>
</section>
<section id="second">
<subsection id="qwerty">
<p>More text</p>
</subsection>
<p>words, words</p>
</section>
</document>
an XPath expression like:
//section//*[@id = '']/text()
would return: "Hello, foo barwords, words"
and one like:
//subsection//*[@id = '']/text()
would return: "Some stuffSome other stuffMore text"
(I realise that here I could just tell it not to select 'subsection'
elements but my real document has a more complex hierachy including
structural elements which share names with formatting elements [and
which are only distinguished by having an 'id' attribute]).
Thanks for your help,
Richard
--
Richard Lewis
richardlewis@xxxxxxxxxxxxxx
|
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








