Hi
Thanks for your post, I have researched as you say and have a good solution
except I am having problems alphabetically sorting the results:
'load the xml file
Dim xtr As XmlTextReader = New
XmlTextReader(Server.MapPath(gstrXMLCountries))
xtr.WhitespaceHandling = WhitespaceHandling.None
Dim xd As XmlDocument = New XmlDocument
xd.Load(xtr)
'retrieve matching nodes
Dim xnl As XmlNodeList = xd.DocumentElement.SelectNodes(tbXPath.Text)
'output the results
lblOutput.Text = ""
Dim xnod As XmlNode
For Each xnod In xnl
'for elements display the corresponding text entity
If xnod.NodeType = XmlNodeType.Element Then
lblOutput.Text += (xnod.NodeType.ToString & ": " & xnod.Name & " = " &
xnod.FirstChild.Value & "<br/>")
Else
lblOutput.Text += (xnod.NodeType.ToString & ": " & xnod.Name & " = " &
xnod.Value & "<br/>")
End If
Next
'clean up
xtr.Close()
Any help would be much appreicated
Thanks
B
"AMDRIT" <am****@hotmail.comwrote in message
news:uv**************@TK2MSFTNGP04.phx.gbl...
There are a plethera of ways to start, a bit of a learning curve to
overcome.
Without even using utilities that are available in the System.XML
namespace, you can accomplish your tasks.
Take a look at SelectNodes()
Take a look at SelectSingleNode()
Take a look at dictionary and hashtable objects
Take a look at dataset and datatable objects
Then you can make it more simple and delve deeper into the utilities
provided within the XML namespace.
"Ben" <Be*@Newsgroups.microsoft.comwrote in message
news:Og******************@TK2MSFTNGP04.phx.gbl...
>Hi
I am a newbe when it comes to XML. I have the Schema below:
<XMLRoot xmlns="http://tempuri.org/xmlTesting.xsd">
<Data1>
<Country>My First Country</Country>
<Town>My Town</Town>
<Link>http://www.MyWebsite.com/</Link>
</Data1>
</XMLRoot>
I can databind a grid etc, but want to work with individual items, I want
to do a number of things:
1) get a distinct list of all countries
2) get all towns and links for a specific country
I will then loop though the results and list them in an ASPX page
Any advice on how to do this would be much appricated.
Thanks
B
PS we are currently using framework 1.1