473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

(XML) Favourites for WebBrowser

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

Nov 21 '05 #1
1 1154
use a XPath:

dim xmlNodes as xml.xmlNodeList
dim xmlNode as xml.xmlNode

(code for initialize and load the doc is omitted)

xmlNodes = xmlDoc.SelectNodes("Favourites/url")

for each xmlNode in xmlNodex
msgbox xmlNodes.Value
next
But you will need to convert the special characters *to* and *from* xml,
using the XMLConvert class.
[]s
Cesar

<zo****@yahoo.com> escreveu na mensagem
news:11**********************@g49g2000cwa.googlegr oups.com...
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
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Charles | last post by:
I create web sites with XHTML 1.0 Transitional, wich is compatible with the XML specification on the W3C web site. I was wondering if it's possible to create real-world web sites with only XML...
7
by: Markus Mohr | last post by:
Hello, tonight I'm looking for a javascript piece of code which enables me to detect whether the user's internet browser has a favourites sidebar open and thus limits the "display space" of the...
2
by: Lee | last post by:
Hi, I am using the WebBrowser control included with VS2005 to view XML files, and they are being displayed correctly as far as I can tell. The problem I am having is saving these XML files to...
2
by: Lee | last post by:
Hi, I am using the WebBrowser control included with VS2005 to view XML files, and they are being displayed correctly as far as I can tell. The problem I am having is saving these XML files to...
2
by: Kurt Waldheim | last post by:
Hi, I want do download a XML file using the WebBrowser class. How can I prevent that the file is converted to HTML code using a stylesheet. Thanks,Kurt
3
by: Stropher | last post by:
I have just created a Word document, saved it as XML-file. Now I have created a WebBrowser-Control and would like to use it to display the file, but how? Could anyone give me some clues on how to...
11
by: Webbert | last post by:
I am trying to display XML in a WebBrowser Control. I receive a data feed of XML and am trying to inject it into the control. I have not been successful in doing so. The only solution I have...
2
by: enjoycaribbean | last post by:
Hello, I want to add a function on my website that allows visitors to add their favourite hotels, villas etc. to a "Whish list" or "My Favourites" list, where they can go back and find all...
2
!NoItAll
by: !NoItAll | last post by:
I am loading an xml document into a vb.net webbrowser object. I can not figure out how to get the xml out of it though. Basically I am going to a URL that has an xml document. It loads just...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.