Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("<?xml version="1.0" encoding="UTF-8"?>
- <user_data>
- <execution_status>0</execution_status>
- <row_count>1</row_count>
- <txn_id>stuetd678</txn_id>
- <person_info>
- <attribute name="firstname">john</attribute>
- <attribute name="lastname">doe</attribute>
- <attribute name="emailaddress">[email protected]</attribute>
- </person_info>
- </user_data>");
- Dim oXML, oNode, sKey, sValue
- Set oXML = Server.CreateObject("MSXML2.DomDocument.4.0")
- oXML.LoadXML(sXML)
- For Each oNode In oXML.SelectNodes("/user_data/person_info/attribute")
- sKey = oNode.GetAttribute("name")
- sValue = oNode.Text
- ' Do something with these values here
- Next
- Set oXML = Nothing
- Dim oXML, oNode, sKey, sValue
- Set oXML = Server.CreateObject("MSXML2.DomDocument.6.0") 'creating the parser object
- oXML.LoadXML(sXML) 'loading the XML from the string
- For Each oNode In oXML.SelectNodes("/user_data/person_info/attribute")
- sKey = oNode.GetAttribute("name")
- sValue = oNode.Text
- Select Case sKey
- Case "execution_status"
- ... 'do something with the tag value
- Case else
- ... 'unknown tag
- End Select
- Next
- Set oXML = Nothing
Add Comment
Please, Sign In to add comment