XML Data read and extract output in an array - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: XML Data read and extract output in an array (/Thread-XML-Data-read-and-extract-output-in-an-array) |
XML Data read and extract output in an array - SweetyChowdhury - 04-08-2013 Hi All, Please see the XML file format that I need to read and extract the value of a particular node (have multiple elements under it) in an array through QTP 11v. Code: <MasterData> Can somebody please help on the same. RE: XML Data read and extract output in an array - basanth27 - 04-09-2013 does this help? Code: Set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile("C:\testme.txt",1) RE: XML Data read and extract output in an array - SweetyChowdhury - 04-09-2013 Thanks Basanth for the above code. It defonatley gives me the element name and its value. Just one more doubt how can remove the </ABC> for all the elements coming in the result. RE: XML Data read and extract output in an array - basanth27 - 04-09-2013 I do not get the </ABC> for the xml data you had provided. Can you please highlight it? RE: XML Data read and extract output in an array - SweetyChowdhury - 04-09-2013 Thanks Basanth for the above code. It defonatley gives me the element name and its value. Just one more doubt how can remove the </ABC> for all the elements coming in the result. Quote:I do not get the </ABC> for the xml data you had provided. Can you please highlight it? Sorry for the confusion. Now from the above code which you provided, I am getting the result as : <Reason>0</Reason> <Number>1</Number> <Load>0</Load> And I want my result to look as below : <Reason>0 <Number>1 <Load>0 I hope that clarifies. Thanks RE: XML Data read and extract output in an array - basanth27 - 04-09-2013 All good ? Code: Set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile("C:\testme.txt",1) RE: XML Data read and extract output in an array - SweetyChowdhury - 04-10-2013 It' perfect Thanks a ton !!! RE: XML Data read and extract output in an array - basanth27 - 04-10-2013 Most Welcome RE: XML Data read and extract output in an array - tanyamrz - 04-25-2013 Hi Sweety, for the deletion of xml data i was not able to reply to that post, instead of that iam replying the answer here Code: Set xmlDoc = CreateObject("Microsoft.XMLDOM") The Out put will be Like Code: - <Fileheaderproperty> Thanks -Tanya RE: XML Data read and extract output in an array - SweetyChowdhury - 05-10-2013 Thanks Tanya for the above code. |