Ignoring strange Parsing errors with Xerces

AYArromyhoode

New Member
I am trying to parse the following url as a DOM Document in Java: http://www.op.org/en/rss-category-home/8.However, when I do this, I get the following error:\[code\]13:51:38,470 ERROR ~ Error processing site Site 1org.xml.sax.SAXParseException: The entity "acirc" was referenced, but not declared. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at logic.server.RssReader.readRss(RssReader.java:44) at logic.server.GatherData.doJobWithResult(GatherData.java:49) at logic.server.GatherData.doJobWithResult(GatherData.java:1)\[/code\]I read somewhere that the Xerces parser in the current JRE is has a bug related to this, so downloaded Xerces2 2.11.0, but still have the same problem.How can I get around this problem. I have no control over the RSS feed itself, but need to parse the XML to process the articles.My code is: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\[code\] DocumentBuilder builder = dbf.newDocumentBuilder(); Document dom = builder.parse(rssUrl.openStream()); NodeList nodes = dom.getElementsByTagName("item"); etc. etc.\[/code\]Any help to get around this problem is really appreciated!EDIT:IF I would try the solution below and add the DTD, where would I do that? The current RSS element is:\[code\]<rss version="2.0" xml:base="http://www.op.org/en/rss-category-home/8" xmlns:dc="http://purl.org/dc/elements/1.1/" content="http://purl.org/rss/1.0/modules/content/" dc="http://purl.org/dc/terms/" foaf="http://xmlns.com/foaf/0.1/" og="http://ogp.me/ns#" rdfs="http://www.w3.org/2000/01/rdf-schema#" sioc="http://rdfs.org/sioc/ns#" sioct="http://rdfs.org/sioc/types#" skos="http://www.w3.org/2004/02/skos/core#" xsd="http://www.w3.org/2001/XMLSchema#">\[/code\]or would I add it to every 'description' element, which containst the XHTML code, something like this? I tried this later solution, but it still gives the same error.\[code\]<description xmlns="http://www.w3.org/1999/xhtml">\[/code\]
 
Back
Top