473,413 Members | 1,807 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,413 software developers and data experts.

HTML to XML

I use a httpWebrequest to download an html page as string, then I would like
to have xml document, but html and xml are "incompatible"
There is a way to convert html to xml?
Nov 11 '05 #1
3 5149
Thank's, I've found a free source code to do that, if someone is
intrested...

SgmlReader 1.1

SgmlReader is an XmlReader API over any SGML document. A command line
utility is also provided which outputs the well formed XML result. HTML is
an SGML grammar, so you can use this tool to convert HTML into well-formed
XML.

http://www.gotdotnet.com/Community/U...4-c3bd760564bc

"Zürcher See" <aq****@cannabismail.com> schrieb im Newsbeitrag
news:10***************@fuchs.cyberlink.ch...
I use a httpWebrequest to download an html page as string, then I would like to have xml document, but html and xml are "incompatible"
There is a way to convert html to xml?

Nov 11 '05 #2
That depends on how well formed the HTML source is. Most likely the answer
is "no", since the HTML format allows for tags without a closing element.
<br> for example does not need a closing </br> tag. Some people do write
their HTML that it's compatible with XML. They write <br /> for example, to
fake an empty XML element when HTML tag does not have a closing tag, but
that doesn't help you if you're looking to retreive arbitrary pages.

You can embed XML data islands into an HTML page, but it doesn't sound like
that this is what you are trying to do.
If you are just looking to load an HTML page into a DOM, then you can
instantiate an Internet Explorer control and have it load the HTML
programmatically. Then you can traverse the DOM in a manner similar to an
XmlDocument. Maybe you can walk the IE DOM to populate an XmlDocument is
that solves your problem.

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

"Zürcher See" <aq****@cannabismail.com> wrote in message
news:10***************@fuchs.cyberlink.ch...
I use a httpWebrequest to download an html page as string, then I would like to have xml document, but html and xml are "incompatible"
There is a way to convert html to xml?

Nov 11 '05 #3
Hi,

Using the Internet Explorer is good enough if your application is a client application and you sit in front of the computer waiting for it to be over because IE can display messageboxes when it bumps into javascript errors.

It's not meant for server processing.

If you do want it to be clean you will have to convert the HTML to XML with a third party tool.

You can try this component:
HTML TO XML
It's currently free.
Jun 13 '06 #4

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

Similar topics

4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
4
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text...
1
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML...
33
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show...
0
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to...
9
by: Patient Guy | last post by:
Taking the BODY element as an example, all of its style attributes ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01, a fact noted in the DOM Level 2 HTML specification. ...
5
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact...
6
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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
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...

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.