[Informa-developer] RE: Exceptions when parsing a rss feed
Status: Beta
Brought to you by:
niko_schmuck
From: Yang S. <ya...@be...> - 2004-04-15 05:05:23
|
Hi, Niko: After I commented out the line you specified, it works fine for = Tomcat. But after I changed my web container to resin (with the patched = informa.jar), it cannot parse the rss feed = (http://today.java.net/pub/q/articles_rss?x-ver=3D1.0). The error it report like this: /*-----------------------------------------------------------------------= ------------- de.nava.informa.core.ParseException: ParseException: Error in building: = http:// oday.java.net/pub/q/articles_rss?x-ver=3D1.0:256: `ü' is an unknown = entity. XML predefines only `<', `&', `>', `'' and `"'. All = other ntities must be defined in an <!ENTITY> definition in the DTD.: = http://today java.net/pub/q/articles_rss?x-ver=3D1.0:256: `ü' is an unknown = entity. XML redefines only `<', `&', `>', `'' and `"'. All = other entit es must be defined in an <!ENTITY> definition in the DTD. at de.nava.informa.parsers.RSSParser.parse(RSSParser.java:118) at de.nava.informa.parsers.RSSParser.parse(RSSParser.java:67) at = com.newsseed.retriever.RetrieverServlet.parseNewsSource(RetrieverSer let.java:73) at = com.newsseed.retriever.RetrieverServlet.service(RetrieverServlet.jav :56) at javax.servlet.http.HttpServlet.service(HttpServlet.java:103) at = com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServle .java:96) at = com.caucho.server.http.Invocation.service(Invocation.java:315) at = com.caucho.server.http.CacheInvocation.service(CacheInvocation.java: 35) at = com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:24 ) at = com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java 163) at com.caucho.server.TcpConnection.run(TcpConnection.java:139) at java.lang.Thread.run(Thread.java:534) http://wiki.java.net/bin/view/Javapedia/WebRss?skin=3Drss *------------------------------------------------------------------------= -----------/ What's wrong with Informa? I guess it is xml parser's problem. Could you = tell me how to fix it? Thanks. Best Regards Yang > -----Original Message----- > From: Niko Schmuck [mailto:nik...@ha...] > Sent: Tuesday, April 13, 2004 4:50 AM > To: inf...@li... > Cc: Yang Sun > Subject: RE: Exceptions when parsing a rss feed >=20 >=20 > Hi Yang, >=20 > Thanks for taking time and reporting on this problem.=20 > Actually this is a > problem with all feeds containing an inline entity=20 > declaration like the > feed you tried to parse. What it does look like is:=20 >=20 > <?xml version=3D"1.0"?> > <!DOCTYPE rdf:RDF [ > <!ENTITY % HTMLlat1 PUBLIC > "-//W3C//ENTITIES Latin 1 for XHTML//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent"> > %HTMLlat1; > ]> > [...] >=20 > Unfortunately we use (historically) an NoOpEntity resolver to=20 > avoid loading > referenced DTDs in an offline scenario currently, so this is=20 > where the problem > occurs. >=20 > > de.nava.informa.core.ParseException: ParseException: Error=20 > on line 222 > of document=20 > > http://today.java.net/pub/q/articles_rss?x-ver=3D1.0: The=20 > entity "uuml" > was referenced, but=20 > > not declared. > > at=20 > de.nava.informa.parsers.RSSParser.parse(RSSParser.java:116) > > at de.nava.informa.parsers.RSSParser.parse(RSSParser.java:66) >=20 > Please uncomment in the file=20 > src/de/nava/informa/parsers/RSSParser.java > around line 109: >=20 > saxBuilder.setEntityResolver(new NoOpEntityResolver()); >=20 > and rebuild (simply by calling ant in the informa base=20 > directory). Please > report if this works for you too. > =20 > Best Regards, > Niko >=20 >=20 >=20 |