|
-
Jul 12th, 2003, 11:52 PM
#1
Thread Starter
Hyperactive Member
XML Elements and Attributes - How to retrive?
<?xml version="1.0" encoding="utf-8"?>
<chimaera>
<servers>
<host ip="172.16.1.30">Chimaera</host>
<host ip="172.16.1.31">Isis</host>
<host ip="172.16.1.32">MySQL</host>
<host ip="172.16.1.33">Ares</host>
<host ip="172.16.1.34">Osiris</host>
<host ip="172.16.1.35">Mars</host>
<host ip="192.16.3.5">James Server</host>
</servers>
<themes value="true" />
<locationupdate path="C:\1.xml" />
</chimaera>
this is my xml file...
how do i loop through it ONCE and retrive the element names and attributes?
such as...
dim mynode as xmlnode
dim myel as xmlelement
for each mynode in xmldoc.documentelement
select case mynode.childnode.name
case "host"
myel.value
case "themes"
myel.value
case "locationupdate"
myel.value
next
rather than...
For Each xmlNode In xmlDoc.SelectNodes("//chimaera/servers/host")
lvwItem.SubItems.Add(xmlNode.Attributes.ItemOf("ip").Value)
Next
and doing three of these loops to get the attributes of ip, value, and path.... any code would be appreciative thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|