Micro Focus QTP (UFT) Forums
Read XML from Web page...help req..!! - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Read XML from Web page...help req..!! (/Thread-Read-XML-from-Web-page-help-req)



Read XML from Web page...help req..!! - rishi345 - 07-09-2008

hi i need to read the output from a HTML page which is a XML data and then store the individual values in the DB. Below is the output which i got using "GetROproperty.innertext" of the Web page.

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <RespGetDeck xmlns="http://www.xyz.com"> <Category><CatID>1234</CatID> <CatName><![CDATA[ data ]]> </CatName><CatDisplayName> <![CDATA[ data ]]> </CatDisplayName><CatDescription> <![CDATA[ data - DD - 272 ]]></CatDescription><ServiceName /><Position>1</Position><Icon> <URL /> <MimeType /> </Icon><DeviceIcon><URL /> <MimeType /></DeviceIcon><DisplayDriver>111</DisplayDriver></Category><TotalCount>11</TotalCount><RespMsg><Code>900</Code><Desc>SUCCESS</Desc></RespMsg></RespGetDeck>

There are two problems:
1. I need to remove the extra characters from the XML data like "-" or spaces in tags. However if i view the source of the HTML page its all fine there. So is there a way to get the View Source of the HTML page??
2. While traversing thru the XML m not able to get all the elements. m usin
Set xmlDoc = CreateObject("Msxml2.DOMDocument")"
Is there another way to do that.

Also the hierarchy in XMl data may vary every time in the HTML output so i need to write a genric function so that i can traverse thru the nodes,childnodes,attributes and store them.

Thanks in Advance..