xml - What is the xpath to select a range of nodes? -


Hello, I have an XML file that is structured like this:

  Lt; Foo & gt; & Lt; Bars & gt; & Lt; / Bars & gt; & Lt; Bars & gt; & Lt; / Bars & gt; ... & lt; / Foo & gt;  

I do not know how to catch several nodes. Someone gives me an example of an xpath expression that holds nodes 100-200 times.

:

  / * / Bar [position () & gt; = 100 and not (status ()> 200)]  

Note :

  1. the exact form From bar elements are selected from 100 to 200 (inclusive).

  2. The evaluation of this XPath expression can be manifold faster than expression using // short name, because of the latter tree Try to avoid using the root reference node always possible to avoid using // short name in such cases.


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -