Jump to content
  • Advertisement
Sign in to follow this  
Niksan2

[.net] XPath and SelectNodes [Solved]

This topic is 3918 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hola, I've hit a problem with trying to sieve some data from an XML document. the document has something like the following. <Row> <Col><Data id='1'>Hello</Data></Col> <Col></Col> </Row> <Row> <Col></Col> </Row> <Row> <Col><Data id='2'>Hello</Data></Col> <Col><Data id='3'></Data></Col> </Row> and so on. Now, I'm wanting to get a XmlNodeList of rows that only have a Data element within its children, is this possible using a single call to SelectNodes using XPath ? I've tried looking at contains() but this requires two params and I'm not sure what I'd put as the second param as the element may not have any text. I've also though about the idea of getting all the Data elements in a list and using the parent member and indexof to work out indices, but with past experience of indexof it can get very slow. Any pointers will be greatly appreciated. Regards, Nik. [Edited by - Niksan2 on October 30, 2007 6:20:51 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!