Micro Focus QTP (UFT) Forums
Need to extract data from XML to excel in QTP - 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: Need to extract data from XML to excel in QTP (/Thread-Need-to-extract-data-from-XML-to-excel-in-QTP)



Need to extract data from XML to excel in QTP - rrdamuluri - 11-03-2010

Hi,
I need to extract some attributes values and element text data from
XML to excel.
Can some one help me.
Hierarch of xml elements is
on>programs>program>images>image>URI
I need to get an attribute TMSID from program element. And for each
TMS ID, need to get image elements category attribute and URI elements
text values. Need to save all this into an external excel sheet. And
for some of the program elements images/image does'nt exist.

Sample XML is attached


RE: Need to extract data from XML to excel in QTP - kamalteja - 11-03-2010

You can use DOM objects to extract values from XML files based on tag names and then store it tovariables and then save it to excel


RE: Need to extract data from XML to excel in QTP - rrdamuluri - 11-03-2010

Well I want to know how to read the values in hierarchy.
1) If Program element is the parent with TMSID attribute, image is grand child which may or may not exist for each program element. (Program/images/image is the hierarchy) And if exists there may be multiple occurrences also.
When there are multiple occurrences excel should get a row for a program's TMSID, each Image category attribute& URI text value combination

2) URI element is the child of image whose text value I want to get for program TMSID attribute.