Re: XMLDoc.Load problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thank you! I'll try it.


Horváth Szilárd wrote:


How can I fix it automaticaly? Or exists somewhere any C# codes for the rules or i have to write all case of errors?
Because i have to write a prorgam which can download a website which is wrong and i have to edit it.

Please stay in the newsgroup.
If you want to parse HTML and not XML then google for HTML agility pack
or SgmlReader.

--

Martin Honnen
http://JavaScript.FAQTs.com/

"Martin Honnen" <mahotrash@xxxxxxxx> a következőket írta üzenetében news:eKtq%23QGXJHA.5052@xxxxxxxxxxxxxxxxxxxxxxx
Horváth Szilárd wrote:

I'd like to know, how can I fix or ignore the XmlDocument Load or LoadXML error when the XML file is wrong (unended tag, missing start tag, missing "" from attribute ...), like IE Developer Toolbar or just a simple Browser?

If the markup you are trying to load is not well-formed XML then you can't load it. It is as simple as that. XML is _not_ HTML tag soup where browsers try to fix your markup errors and try to guess how the document structure is meant to look.
So you need to fix the problem at the source, when you create the XML. Use APIs like XmlWriter for that.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

.



Relevant Pages

  • Re: ruby html (or xhtml) forms class...
    ... xx is a library designed to extend ruby objects with html, xhtml, and xml ... xml or xhtml as clean looking and natural as ruby it self. ... attributes may be passed to any tag method as either symbol or string. ...
    (comp.lang.ruby)
  • Re: Processing XML thats embedded in HTML
    ... the Priority tag = 1. ... Or that it isn't well-formed XML, ... which is why I think it's the HTML. ... With libxml2dom I'd do something like this: ...
    (comp.lang.python)
  • Re: Stripping HTML from RSS feed
    ... that it reads correctly are the ones that don't have HTML. ... it's got to be a "problem" with rss2array. ... can I parse an XML database using PHP? ... The XML tag is, but the script I use to parse it ...
    (comp.lang.php)
  • Re: XML in XHTML
    ... >> The solutions include using tag names which don't conflict with HTML ... >> tag names, putting all your tags in a different namespace, ... When you have XML inside an XML island IE has full support for namespaces, ...
    (comp.lang.javascript)
  • Processing XML thats embedded in HTML
    ... I've done parsing before with the xml.dom.minidom module on just ... plain XML, but I cannot get it to work with this HTML page. ... the Priority tag = 1. ...
    (comp.lang.python)