View Single Post

  #6 (permalink)  
Old 07-06-2009, 05:21 AM
basanth27 basanth27 is offline
Junior Member
 
Join Date: Jul 2009
Posts: 12
basanth27 is on a distinguished road
Try this,

Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
xmlDoc.load("c:\test.xml")
Set objNodeList = xmlDoc.getElementsByTagName("PutYourTagHere")

For i = 0 To (objNodeList.length - 1)
set str = objNodeList.Item(i)
print str.text
Next

You can get tonnes of information about XMLUTIL object from the QTP Help. The above one is using API.

Try this if you want to use XMLUtil Object,

Set doc = XMLUtil.CreateXML()

doc.LoadFile "c:\example.xml"

Set root = doc.GetRootElement

msg = "My name is "

nameStr = root.ElementName()

valueStr = root.Value()

msgbox msg+nameStr + " and my value is " + valueStr


Let me know if it answers your question.
Reply With Quote