c# - XMLException when processing RSS -
i've been trying process rss feeds using argotic newsreader application. of them works fine, on feed (like this) breaks following:
additional information: security reasons dtd prohibited in xml document. enable dtd processing set dtdprocessing property on xmlreadersettings parse , pass settings xmlreader.create method.
the error straightforward, passed xmlreadersettings
object dtdprocessing
enabled. following appeared:
an unhandled exception of type 'system.xml.xmlexception' occurred in system.xml.dll additional information: ';' character, hexadecimal value 0x3b, cannot included in name. line 9, position 366.
the code using:
xmlreadersettings settings = new xmlreadersettings(); settings.ignorecomments = true; settings.ignorewhitespace = true; settings.dtdprocessing = dtdprocessing.parse; xmlreader reader = xmlreader.create(this.url, settings); rssfeed feed = new rssfeed(); feed.load(reader);
what missing?
the exception telling rss feed illegal - specifically, name contains ;
character. w3c specification appears prohibit this:
document authors encouraged use names meaningful words or combinations of words in natural languages, , avoid symbolic or white space characters in names. note colon, hyphen-minus, full stop (period), low line (underscore), , middle dot explicitly permitted.
the ascii symbols , punctuation marks, along large group of unicode symbol characters, excluded names
since other rss readers complained feed invalid. @ time of writing however, w3c validator shows valid!
according msdn documentation xmlreadersettings.conformancelevel, issue cause exception whatever conformancelevel
, might find setting in xmlreadersettings can turn behaviour off (supply settings xmlreader.create). otherwise, if feed can't fixed, you'll have perform pre-processing on it.
Comments
Post a Comment