Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting a specific node value
Message
 
 
To
27/09/2002 20:50:26
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00705504
Message ID:
00705520
Views:
8
This message has been marked as the solution to the initial question of the thread.
I'm not sure what you're looking for:
loItem = loXml.selectSingleNode("//Top/Item")
? loItem.getAttribute("Name")
loItem = loItem.nextSibling
? loItem.getAttribute("Name")

* or

loItem = loXml.selectSingleNode('//Top/Item[@Name="FirstItem"]')
? loItem.getAttribute("Value")
>Assuming I have an XML like this:
>
>
><Top>
>   <Item Name="FirstItem" Value="1"/>
>   <Item Name="SecondItem" Value="2"/>
></Top>
>
>
>How can I proceed to obtain FirstItem value?
>
>I tried the following, which works, but will only give the first item's value:
>
>
>loXML=CREATEOBJECT('MSXML.DOMDocument')
>loXML.LoadXML(FILETOSTR('D:\B.XML'))
>loXML.SelectSingleNode('//Top/FirstItem')
>? loNode.GetAttribute('Value')
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform