How to load HTML file using XmlDocument class
-
How to load HTML file using XmlDocument class I try to do System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(path); but html document not considered by doc.Load method like regullar xml document since what have some unclosed tags such as an other unwell formated things( Can i actually load this html file by using System.Xml.XmlDocument() for purpose transform this HTML file into an XML file by using XSLT. THANK
-
How to load HTML file using XmlDocument class I try to do System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(path); but html document not considered by doc.Load method like regullar xml document since what have some unclosed tags such as an other unwell formated things( Can i actually load this html file by using System.Xml.XmlDocument() for purpose transform this HTML file into an XML file by using XSLT. THANK
As you have found, not all HTML documents are XHTML. Therefore, a DOM class will not load them. An XSLT can generate non XML documents, but it cannot work with documents that are not XML to start with, you need a different solution.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
How to load HTML file using XmlDocument class I try to do System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(path); but html document not considered by doc.Load method like regullar xml document since what have some unclosed tags such as an other unwell formated things( Can i actually load this html file by using System.Xml.XmlDocument() for purpose transform this HTML file into an XML file by using XSLT. THANK
HTML doesn't conform to XML standards. However XHTML does. The following text comes from the Wikipedia article for XHTML: Whereas HTML is an application of Standard Generalized Markup Language (SGML), a very flexible markup language, XHTML is an application of XML, a more restrictive subset of SGML. A solution to your problem would be to convert your HTML code to XHTML which can be understood by the XML parser. I'm not aware of a component that can do this. However this article[^] explains the processes involved.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
How to load HTML file using XmlDocument class I try to do System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(path); but html document not considered by doc.Load method like regullar xml document since what have some unclosed tags such as an other unwell formated things( Can i actually load this html file by using System.Xml.XmlDocument() for purpose transform this HTML file into an XML file by using XSLT. THANK
Personally, I do use SgmlReader[^]. In addition you could use my Zeta Html Tidy[^] library. I am using both, SgmlReader andy Zeta Html Tidy, together in some projects.
• My personal 24/7 webcam - Always live ;-) • Zeta Producer Desktop CMS - Intuitive, completely easy-to-use CMS for Windows. • Zeta Helpdesk - Open Source ticket software for Windows and web. • Zeta Uploader - Easily send large files by e-mail. Windows and web client.
-
How to load HTML file using XmlDocument class I try to do System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(path); but html document not considered by doc.Load method like regullar xml document since what have some unclosed tags such as an other unwell formated things( Can i actually load this html file by using System.Xml.XmlDocument() for purpose transform this HTML file into an XML file by using XSLT. THANK
THNAK ALL