Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<OrderInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<OrderedBy>
<UserID>12345</UserID>
</OrderedBy>
</OrderInfo>
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<orderInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<OrderedBy xmlns="http://www.clientwebsite.com/">
<UserID>12345</UserID>
</OrderedBy>
</OrderInfo>
o:=ComObjCreate("MSXML2.DOMDocument.6.0")
o.async:=false
o.loadXML(data)
node:=o.selectSingleNode("//orderInfo/OrderedBy/UserID")
UserID:=Node.text
MsgBox,0,UserID,%UserID%
Why does the existence of the namespace (xmlns=) in <OrderedBy> cause the code to fail? How can I fix it? Thanks, Joe