hey guys, xdocument being finicky 1 of xml feeds have parse, , keeps giving me error
'=' unexpected token. expected token ';'. line 1, position 576.
which xdocument crying loose "=" sign in xml document.
i don't have control on source xml document, need either xdocument ignore error, or use other class. ideas on either one?
it won't make xml, if need load bad document html agility pack tool. can overlook many of things make html not xhtml , not xml-like, erroneous xml input parsed too. object model expresses similar xmldocument. e.g.
htmldocument doc = new htmldocument(); doc.load("file.xml"); foreach(htmlnode link in doc.documentelement.selectnodes("//a[@href"]) { htmlattribute att = link["href"]; att.value = fixlink(att); } doc.save("file.htm");
or can use agility pack clean xml , feed clean output real xml parser further processing.
this quick , dirty trick i've used one-time tasks. it's not recommended on proper solution.
what recommended if time permits somehow format/fix erroneous xml content (e.g. maybe in string form, or using tool) before feeding xml parser.
Comments
Post a Comment