Z
zoneal
I'm making a "favourites" for a browser, as i may have said in previous
post. So I want to be able to read a simple xml's <Url>
<Favourites>
<url>http://www.google.ca</url>
</Favourites>
Any Idea's? I've looked around on code sites, but they only let me
display Favourites and URL...
I tried something along the lines of
Dim mx As XmlReader = New XmlTextReader("C:\myxml.xml")Do While
(mx.Read())If mx.NodeType = XmlNodeType.DocumentType
ThenMessageBox.Show(mx.Name)ElseIf mx.NodeType = XmlNodeType.Element
ThenMessageBox.Show(mx.Name & " - " & mx.Value)While
(mx.MoveToNextAttribute())MessageBox.Show(mx.Name & " - " &
mx.Value)End WhileElseIf mx.NodeType = XmlNodeType.Comment
ThenMessageBox.Show(mx.Value)End IfLoop I know this is just a code
example, but I thought I would be able to read whats between the
values, or write between two values.I COULD just have it readthe actual
url instead of the tag url... but whats the fun in that? Will my way
work?In this code, there is something where it could read <Url =
http://www.google.ca> </url>Would this be the same idea? Or would it
not be as efficient?
Thank you
post. So I want to be able to read a simple xml's <Url>
<Favourites>
<url>http://www.google.ca</url>
</Favourites>
Any Idea's? I've looked around on code sites, but they only let me
display Favourites and URL...
I tried something along the lines of
Dim mx As XmlReader = New XmlTextReader("C:\myxml.xml")Do While
(mx.Read())If mx.NodeType = XmlNodeType.DocumentType
ThenMessageBox.Show(mx.Name)ElseIf mx.NodeType = XmlNodeType.Element
ThenMessageBox.Show(mx.Name & " - " & mx.Value)While
(mx.MoveToNextAttribute())MessageBox.Show(mx.Name & " - " &
mx.Value)End WhileElseIf mx.NodeType = XmlNodeType.Comment
ThenMessageBox.Show(mx.Value)End IfLoop I know this is just a code
example, but I thought I would be able to read whats between the
values, or write between two values.I COULD just have it readthe actual
url instead of the tag url... but whats the fun in that? Will my way
work?In this code, there is something where it could read <Url =
http://www.google.ca> </url>Would this be the same idea? Or would it
not be as efficient?
Thank you