Getting node list

KI-ChrisE

Member
Joined
Jun 19, 2005
Messages
5
Programming Experience
1-3
Hi there,
I've got some code I'm using to read an XML file:

System.Xml
XmlDocument etc etc

Now my question is - with my XML file I have such things as:

PHP:
<bla>
<name>
<desc>
<valuesss>
<test>
</bla>
<bla>
<name>
<desc>
<valuesss>
<test>
<red>
<blue>
</bla>

Is there anyway I can go through the XML list... and retrieve all the node names - so in this case, it would return:

name
desc
valuesss
test
red
blue

Thanks,

Chris
 
Ah - so that's who you are! :) You, without knowing, got me started on this in the first place. :D

I found that demo on Google ha.

Now - from what I understand - that code goes through and reads XML.

I've done that part & it works well.

What I'm trying to achieve is this:

The program will read the XML file. Then it'll show all the fields available in each 'row' of XML. Then they'll be able to select the fields they want to transfer to MySQL. Thus it'll copy them across.

So in other words here - we're not trying to select individual bits of data... but simply a list of fields.

So in your XML example:

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<family>
  <name gender="Male">
	<firstname>Tom</firstname>
	<lastname>Smith</lastname>
  </name>
  <name gender="Female">
	<firstname>Dale</firstname>
	<lastname>Smith</lastname>
  </name>
 <name gender="Male">
	<firstname>Kaat</firstname>
	<lastname>FromVbDotNetForums</lastname>
  </name>
 <name gender="Male">
	<firstname>Kaat</firstname>
	<lastname>Unknown</lastname>
  </name>
</family>

For every 'family' there is firstname, lastname.

I want to give the users the option to select firstname nnd/or lastname and then click copy to db - then it'll copy firstname and/or lastname in every 'family' across to the db.

Hope that's a bit clearer! :)

Thanks,

Chris
 
Back
Top