03-13-2012, 08:47 AM
Hello,
I am currently trying to extract data from an XML file using QTP. This is fairly new to me so please bear with me. The XML file contains many "Operation" nodes. From these nodes, I want to filter the appropriate node based on Operation ID and Operation Type. After that, I want to capture all of the Condition IDs for this Node. I would appreciate greatly any information I can use to start and build on.
Here is my sample code that need revision:
I am currently trying to extract data from an XML file using QTP. This is fairly new to me so please bear with me. The XML file contains many "Operation" nodes. From these nodes, I want to filter the appropriate node based on Operation ID and Operation Type. After that, I want to capture all of the Condition IDs for this Node. I would appreciate greatly any information I can use to start and build on.
Here is my sample code that need revision:
Code:
Set xmlDoc = XMLUtil.CreateXML()
Set objNode=xmlDoc.selectSingleNode(./OPERATION[@ID=REMOVEEQPT]")
<OPERATION ID="INSTALLEQPT" TYPE="FIX" CONFIRMATION="">
<ATTRIBUTES>
<ATTRIBUTE ID="EQPTTYPE"/>
</ATTRIBUTES>
<CONDITIONS>
<CONDITION ID="UPGRADEABLE"/>
<CONDITION ID="EQUIPMENT_IS_OK"/>
</CONDITIONS>
</OPERATION>
<OPERATION ID="REMOVEEQPT" TYPE="UNINSTALL" CONFIRMATION="">
<ATTRIBUTES>
<ATTRIBUTE ID="EQPTTYPE"/>
<ATTRIBUTE ID="EQPTCOLOR"/>
<ATTRIBUTE ID="EQPTAGE"/>
</ATTRIBUTES>
<CONDITIONS>
<CONDITION ID="PROVISIONED"/>
<CONDITION ID="NOT_ON"/>
<CONDITION ID="CALL_HELP"/>
</CONDITIONS>
</OPERATION>