473,508 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

load html file into an XmlDocument?

How do you load an html file into an XmlDocument?

Oct 9 '08 #1
5 10059
Hello Andy ,

usually you don`t do this as HTML ISNOT XML
maybe you would bether explain a bity more what you want , cause just
loading a HTML file into a XmlDocument isn`t going to work
however you could just load the HTML data in a XML node in a XML document
and you could etc etc etc etc etc etc

regards

Michel Posseth [MCP]
http://www.vbdotnetcoder.com



"Andy B" <a_*****@sbcglobal.netschreef in bericht
news:OT**************@TK2MSFTNGP02.phx.gbl...
How do you load an html file into an XmlDocument?

Oct 9 '08 #2
Andy B wrote:
How do you load an html file into an XmlDocument?
If the HTML happens to be XHTML then you should be able to load it into an
XmlDocument just like any normal XML file.

Otherwise the HTML is very unlikely to actually be valid XML, so you won't
be able to load it at all.

Why exactly do you want to be able to do that?

--

(O)enone
Oct 9 '08 #3
Andy,

Make a string of it and put it in one element.

Cor

"Andy B" <a_*****@sbcglobal.netschreef in bericht
news:OT**************@TK2MSFTNGP02.phx.gbl...
How do you load an html file into an XmlDocument?
Oct 10 '08 #4
Andy B wrote:
How do you load an html file into an XmlDocument?
Consider to use http://www.codeplex.com/htmlagilitypack instead, it has
an HtmlDocument to parse and load a HTML document.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Oct 10 '08 #5
Ok. I figured out how to do what I needed and I had to use the WebBrowser
control, but that's ok since I wanted to use it somewhere in the project
anyways.
"(O)enone" <oe****@nowhere.comwrote in message
news:gc**********@aioe.org...
Andy B wrote:
>How do you load an html file into an XmlDocument?

If the HTML happens to be XHTML then you should be able to load it into an
XmlDocument just like any normal XML file.

Otherwise the HTML is very unlikely to actually be valid XML, so you won't
be able to load it at all.

Why exactly do you want to be able to do that?

--

(O)enone

Oct 11 '08 #6

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

Similar topics

2
22437
by: Tom Pearson | last post by:
I have created an XmlDocument and can see that this is correctly formed and has a root element If I Save the doc to a file and reload it all works o If I dump the doc to a stream, again using the...
1
2032
by: teddy311 | last post by:
Hello group, Why, when I execute the c# code on the xhtml validate file, the program insert a couple of hooks at the end of this line ? ....DTD/xhtml1-transitional.dtd"> _The c# code :_ ...
2
8316
by: stevag | last post by:
Hello, I am developing an application whose main goal is to read from a dynamic ..asp Internet URL. This URL automatically produces an RSS file, which I further want to load into my application...
3
6226
by: Atara | last post by:
I use the following code to load xml file: Dim srcXml As String = pathDataFiles & "test.xml" Dim XmlDoc As New Xml.XmlDocument XmlDoc.Load(srcXml) If my xml file starts with the line - ...
2
1839
by: supercodepoet | last post by:
I have cXml document I want to load to parse. The document has a DOCTYPE element that points to an external dtd via http. When the document loads it trys a web request which I am assuming is to...
10
13913
by: lamxing | last post by:
Dear all, I've spent a long time to try to get the xmldocument.load method to handle UTF-8 characters, but no luck. Every time it loads a document contains european characters (such as the...
4
1666
by: DanThMan | last post by:
The following code works when I debug and when I install the software and run the .exe, but if I try to open the form in the designer (which causes this code to run), I get an error: Private Sub...
0
1212
by: RealityMasque | last post by:
Platform: Windows XP Pro IDE: Visual Studio 2005 Language: C# (.NET 2.0.505727) Symptom: In debug, my page can load the xml from an external website into an XmlDocument object. When I...
4
3260
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... We've got a lot of places in our code where we read relatively small xml user preference blocks. Currently that's creating a new XmlDocument in every spot. I was thinking we might see...
0
7326
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,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.