Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting a specific node value
Message
 
 
À
27/09/2002 20:50:26
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00705504
Message ID:
00705520
Vues:
9
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform