>I have an xml file that talks to one of my web services. This xml file always holds one record. Also, the format is not as simple as the one generated by cursortoxml, but a little more complex. I was advised here to use xmldom to browse through the xml file, but i find it difficult to find what i need in order to execute a simple task:
>i would like to loop through all the nodes. If the name of the node is some field i need, i'll just save it in a variable. That's it! Could anyone give me an example on how to achieve this?
Assuming the xml file you're talking about is the one you posted in Message#
658658:
loXML = CREATEOBJECT("MSXML2.DOMDocument.3.0")
loXML.Async = .F.
loXML.loadXML(FILETOSTR("msg658658.xml"))
loRoot = loXML.documentElement
IF !ISNULL(loRoot)
loElm = loRoot.selectSingleNode("country")
? "Country code:",loElm.text
loElm = loRoot.selectSingleNode("pick_up/pick_up_location")
? "Pick up location:",loElm.text
ENDIF
----------------------------------
António Tavares Lopes