Hello guru,
I'm newbie in programming so I can't find a solution to a very simple question
Here's XML file:
<?xml version="1.0" encoding="UTF-8"?>
<family>
<name_1 gender="Male">
<firstname>Tom</firstname>
<lastname>Smith</lastname>
<optionsid>first</optionsid>
</name_1>
<name_1 gender="Female">
<firstname>John</firstname>
<lastname>Smith</lastname>
<optionsid>second</optionsid>
</name_1>
<name_1 gender="Male">
<firstname>Trevor</firstname>
<lastname>Smith</lastname>
<optionsid>first</optionsid>
</name_1>
<Options id="first">
<duration>30</duration>
<car>Volvo</car>
</Options>
<Options id="second">
<duration>50</duration>
<car>Rover</car>
</Options>
</family>
My task is to find value in particular node (example: to find node where first name is "John") then get other value from this node (example: get optionsid value (it will be "second")). Then I will do a search for a node with a particular optionsid ("second") and get values from this node (duraton, car)
There's a code to find a node
Dim new_path As System.Xml.XmlNode = m_xmld_2.SelectSingleNode("//firstname[.='John']")
...but what else to do ?
Hope for help
Thanks in advance
I'm newbie in programming so I can't find a solution to a very simple question
Here's XML file:
<?xml version="1.0" encoding="UTF-8"?>
<family>
<name_1 gender="Male">
<firstname>Tom</firstname>
<lastname>Smith</lastname>
<optionsid>first</optionsid>
</name_1>
<name_1 gender="Female">
<firstname>John</firstname>
<lastname>Smith</lastname>
<optionsid>second</optionsid>
</name_1>
<name_1 gender="Male">
<firstname>Trevor</firstname>
<lastname>Smith</lastname>
<optionsid>first</optionsid>
</name_1>
<Options id="first">
<duration>30</duration>
<car>Volvo</car>
</Options>
<Options id="second">
<duration>50</duration>
<car>Rover</car>
</Options>
</family>
My task is to find value in particular node (example: to find node where first name is "John") then get other value from this node (example: get optionsid value (it will be "second")). Then I will do a search for a node with a particular optionsid ("second") and get values from this node (duraton, car)
There's a code to find a node
Dim new_path As System.Xml.XmlNode = m_xmld_2.SelectSingleNode("//firstname[.='John']")
...but what else to do ?
Hope for help
Thanks in advance