* sam wrote in microsoft.public.dotnet.xml:
>I use in my csharp code this xml:
<doc>
<item Id="1">
<item>1</item>
</item>
<item Id="1">
<item>2</item>
</item>
<item Id="2">
<item>A</item>
</item>
<item Id="3">
<item>B</item>
</item>
</doc>
And I need to exclude all items that Id="1" and then in the result set, get
the a range of nodes, for exmpale the first to third nodes.
I use this /doc/item[@Id != "1" and (position() >0 and position() <= 2) ]
but there is no result, why ?
Because you are trying to further filter a node set that does not exist.
The predicate you specify above evaluates the three conditions at once,
and there are no elements matching all three conditions. You will have
to use multiple predicates.
http://www.w3.org/TR/xpath#location-paths
has good examples.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de ·
http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 ·
http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·
http://www.websitedev.de/