XPathNodeIterator with index

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<bookstore><br/>
<book genre="autobiography" publicationdate="1981-03-22" ISBN="1-861003-11-0 <br/>
<title>The Autobiography of Benjamin Franklin</title><br/>
<author><br/>
<first-name>Benjamin</first-name><br/>
<last-name>Franklin</last-name><br/>
</author><br/>
<price>8.99</price><br/>
</book><br/>
<book genre="novel" publicationdate="1967-11-17" ISBN="0-201-63361-2 <br/>
<title>The Confidence Man</title><br/>
<author><br/>
<first-name>Herman</first-name><br/>
<last-name>Melville</last-name><br/>
</author><br/>
<price>11.99</price><br/>
</book><br/>
<book genre="philosophy" publicationdate="1991-02-15" ISBN="1-861001-57-6 <br/>
<title>The Gorgias</title><br/>
<author><br/>
<name>Plato</name><br/>
</author><br/>
<price>9.99</price><br/>
</book><br/>
</bookstore><br/>
<br/>
This is my XML file, in this titles count is 3. I want to access the information with Index. like,

XPathNodeIterator nodes = navigator.Select("/bookstore/book/title");
This nodes can not be used with Index, I want to access imediately nodes[1], How can I achieve this.?

View the full article
 
Back
Top