Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Traversing/Parsing XML file in PB - Need Help

220 views
Skip to first unread message

Melissa

unread,
Aug 19, 2009, 1:39:05 PM8/19/09
to
Hi,

Need help on how to get values in an XML file. My XML would
something like the one I attached. Depending on the input
status attribute (success or fail), I would need to retrieve
the UnallocatedQuantity value. I was able to go as far as
checking the attribute value, but couldn't quite figure out
how to get the value for the quantity. The code I tried
just keeps on returning the 1st one it found. Please help.

xmldom.ConnectToNewObject("Microsoft.XMLDOM")

//Load XML File
xmldom.LoadXml(s_inline)

xml_node_list = xmldom.SelectNodes("//Input")
li_length = integer(xml_node_list.length) - 1
FOR i = 0 to li_length
xml_node = xml_node_list.item(i)
ls_attribute =xml_node.getAttribute("status")
IF TRIM(lower(ls_attribute)) = "success" THEN
//GET UNALLOCATEDQUANTITY
xml_doc =
xml_node.SelectSingleNode("//UnallocatedQuantity")
s_text = xml_doc.NodeTypedValue
ELSE
//Set Quantity to 0
END IF
NEXT

Output.xml

f.gonzale...@gmail.com

unread,
May 7, 2015, 12:13:26 PM5/7/15
to
try to use pbdom_doc
0 new messages