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

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -