vbscript and going through xml documents
Posted on 2004-09-07
I have an xml document that I would like to step through part of it and then search the rest of the document.
Overall layout is:
<network drive id="0" drive_letter="z:" drive_path="\\servername\share">
<network drive id="1" drive_letter="z:" drive_path="\\servername\share">
there are a few more network drive elements exactly the same but different mappings
<recent_document id="2" document_name="blah" document_path="c:\desktop\folder1">
<recent_document id="3" document_name="blah2.doc" document_path="c:\desktop\folder1">
there are many recent documents if it matters all the id #'s are unique starting from 0 in network drives
Since there are few network drives I was trying to use
set node = xmlDoc.selectSingleNode("\\network_drives\network_drive")
but I got stuck because I did not know how to differentiate between the nodes within <network_drives> because they are all named network_drive but have different attributes. Also the command line spit out object required : 'node'
For the recent documents I basically want to do the same thing but I figure a loop would be better because there are far more entries. All I really care about is analyzing the path in the document and checking it against a variable.
Can anyone guide me in the correct way of using select single node and / or a loop to go through my xml document and get me the information i need?
Thanks in advance,