Poll: Did you understand the thread Problem well
You do not have permission to vote in this poll.
Yes
0%
0 0%
No
0%
0 0%
Total 0 vote(s) 0%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script to read a XML file
#4
Not Solved
I got the code for retriving node values but i was not able to find the code for retriving attribute value.

i want to get the value of attribute "ref" in the below xml:
---------------------------------------------

Code:
<States>
   <State ref="FL">
      <name>Florida</name>
      <capital>Tallahassee</capital>
   </State>
   <State ref="IA">
      <name>Iowa</name>
      <capital>Des Moines</capital>
   </State>
</States>

VBScript:

Code:
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load("states.xml")

Dim objChildNodes, strNode
Set objChildNodes = objXMLDoc.documentElement.childNodes<State>

For Each strNode In objChildNodes
   document.write(strNode.nodeName & "<br>")
Next
Reply


Messages In This Thread
Script to read a XML file - by Anand - 05-19-2011, 06:22 PM
RE: Script to read a XML file - by suresh vasu - 05-19-2011, 06:42 PM
RE: Script to read a XML file - by deepaksporty - 05-19-2011, 07:01 PM
RE: Script to read a XML file - by Anand - 05-24-2011, 12:16 PM
RE: Script to read a XML file - by Anand - 05-30-2011, 12:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to read a text file using FSO from bottom to up order?? vallalarasu.p 0 2,505 10-13-2014, 11:14 AM
Last Post: vallalarasu.p
  XML FILE COULD NOT BE PARSED tripathy.pilu23 1 8,126 04-18-2014, 06:38 AM
Last Post: kgovadav
  Getting an 'Error in XML document' Error when submitting web services XML luckyexpert 0 3,118 08-20-2013, 10:23 PM
Last Post: luckyexpert
  Read text from text file and save it into a variable in qtp arpan 3 12,957 06-19-2013, 08:34 PM
Last Post: arpan
  XML Data read and extract output in an array SweetyChowdhury 9 7,735 05-10-2013, 03:05 PM
Last Post: SweetyChowdhury

Forum Jump:


Users browsing this thread: 1 Guest(s)