Sign in to follow this  
Followers 0
buymeapc

XML Search For Node

5 posts in this topic

Hi all,

I've been searching the forums and I can't quite find what I need. I have XML documents with several levels of child nodes. The child nodes are not all the same within the XML docs and the paths can change. I know which node I want the data from, but I can't quite figure out how to browse through the XML document searching for one node that could be anywhere in the tree.

How could I find a random node in an XML document and retrieve its data?

Thanks!

Share this post


Link to post
Share on other sites



Search for posts using the _XMLDomWrapper.au3 UDF from eltorro. It uses XPath syntax.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I had been been basing my searches off of that. Great tool, but couldn't quite figure out how to use it for my specific need. Every function required the node path and that was the part I didn't have, sadly. I ended up reading the entire xml into a variable and using the StringBetween function to find the (random) node in question. Not as elegant as I would have liked, but it gets the job done.

Thanks for the help! ;)

Share this post


Link to post
Share on other sites

Dunno is it what you need, but it's the best XPath tutorial I've ever found:

http://www.zvon.org/xxl/XPathTutorial/General/examples.html

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0