Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing XML File Using MsXml
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00908255
Message ID:
00908455
Views:
25
Hi Rich,

The following code shows one way of doing that. See that the "SelectSingleNode" method takes an XPath expression as paramenter; so it might vary depending on your situation.

Please, verify if this can help you and otherwise, let us know.
LOCAL lcXML as String
LOCAL loDOM as MSXML2.XMLDocument
LOCAL loAtt as MSXML2.IXMLDOMAttribute 

TEXT TO lcXML TEXTMERGE NOSHOW PRETEXT 1+2+4
  <?xml version="1.0" ?>
  <Parent>
    <FundShareClass _id="MA" />
  </Parent>
ENDTEXT

loDOM = CREATEOBJECT("MSXML2.DOMDocument")
loDOM.LoadXML(lcXML)

loAtt = loDOM.selectSingleNode("/Parent/FundShareClass/@_id")

?loAtt.Text 

STORE null TO loDOM, loAtt
-----
Fabio Vazquez
http://www.fabiovazquez.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform