Is there anyway to convert an html file to an xml file while maintaining all the features of the html file. I have converted using SGML Reader. But, It is just giving an xml file,which is not proper. Please throw some light on this. Below is SGML Reader
code.
harinarayana...
Member
63 Points
130 Posts
Html to xml conversion
Sep 07, 2012 12:31 PM|LINK
Hi,
Is there anyway to convert an html file to an xml file while maintaining all the features of the html file. I have converted using SGML Reader. But, It is just giving an xml file,which is not proper. Please throw some light on this. Below is SGML Reader code.
public static XmlDocument FromHtml(TextReader reader) { // setup SGMLReader Sgml.SgmlReader sgmlReader = new Sgml.SgmlReader(); sgmlReader.DocType = "HTML"; sgmlReader.WhitespaceHandling = WhitespaceHandling.All; sgmlReader.CaseFolding = Sgml.CaseFolding.ToLower; sgmlReader.InputStream = reader; // create document XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; doc.XmlResolver = null; doc.Load(sgmlReader); return doc; }SohailShaikh
Contributor
6119 Points
1167 Posts
Re: Html to xml conversion
Sep 07, 2012 01:22 PM|LINK
Check this link may be its help full to you
http://www.codeproject.com/Articles/10792/Convert-HTML-to-XHTML-and-Clean-Unnecessary-Tags-a
Sohail Shaikh
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Html to xml conversion
Sep 09, 2012 01:22 AM|LINK
Hi,
As far as I see,I think this is due to a 3-rd party tool,so maybe you can go to the forum to ask for that more:
SGMLReader - MindTouch Community Forums