vbscript - Incorrect syntax was used in a comment -
please consider kind of xhtml document:
<?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head></head> <body> <!--- comment 3 dashes causes parsing error ---> <!-- rest of xhtml --> </body> </html>
and partial vbscript code i'm trying parsing:
with createobject("msxml2.domdocument.6.0") .async = false .setproperty "prohibitdtd", false .validateonparse = false .setproperty "selectionlanguage", "xpath" .setproperty "selectionnamespaces", "xmlns:xhtml='http://www.w3.org/1999/xhtml'" .load(url) end
i error report:
incorrect syntax used in comment
apparently because comment uses 3 dashes.
does know how resolve (without using http request , correcting xhtml source)?
as standard states:
for compatibility, string " -- " (double-hyphen) must not occur within comments.
no decent parser should accept 'xml' well-formed. may search faulty parser - this indicates version of beautifulsoup (3.08) may accept -- in comments - real solution either clean data before .loadxml or - better - take big stick author.
Comments
Post a Comment