Mark, use JTidy for consuming HTML it supports handling non-well-formed documents. Another choice is CyberNeko HTML Parser http://people.apache.org/~andyc/neko/doc/index.html based on Xerces XNI.
-- dims On 5/1/05, Mark Leone <[EMAIL PROTECTED]> wrote: > Yes, you're right. I didn't realize the scope of the dependencies the > static methods in XMLUtils have on the rest of the axis code. I placed > all the jar files from the axis distribution in the shared directory, > and no more NCDFEs. (I moved just saaj.jar at first, but I got other > NCDFEs, so I moved all the axis jars.) > > But now I'm getting fatal SAXParser errors when I try to ingest HTML > 4.01 documents that are not well-formed XML. Xerces has implemented HTML > DOM, but apparently there's no support for creating HTMLDocumentImpl > objects from an InputStream serving an HTML 4.01 document. > Jeff wrote: > > >Hi Mark, > > > >This is so obviously a classpath issue. It might be triggered through bad > >input though. Checking that conn.getInputStream() generates well-formed > >XML would be a good first step (dump it a file on your hard disk and drag > >the file into a web browser). > > > > > >Jeff > > > > > >----- Original Message ----- > >From: "Mark Leone" <[EMAIL PROTECTED]> > >To: <[email protected]> > >Sent: Saturday, April 30, 2005 9:37 AM > >Subject: Re: What's SOAP got to do with it? > > > > > > > > > >>Tomcat is not producing a stack trace for this event in its log files. I > >>asked for some advice on this on the Tomcat list, and if I get a full > >>stack trace I'll post it here. Or maybe I'll find that I have a Tomcat > >>problem that's causing the original error as well. Thanks for offering > >>to look at the stack trace. > >> > >>BTW, I tried it from my java IDE, but I don't have an IDE integrated > >>with Tomcat, and I got a different error when I tried it- probably > >>because I wasn't invoking from within a servlet engine. > >> > >>-Mark > >> > >>Davanum Srinivas wrote: > >> > >> > >> > >>>can u please post the whole stacktrace... > >>> > >>>-- dims > >>> > >>>On 4/30/05, Mark Leone <[EMAIL PROTECTED]> wrote: > >>> > >>> > >>> > >>> > >>>>I have a servlet in which I'm making a static call to > >>>>org.apache.utils.XMLUtils.newDocument(InputStream inp). Tomcat, my > >>>>servlet container, returns a class definition not found error, looking > >>>>for SOAPException. I've gone through the XMLUtils source code ( and > >>>>source code for all methods invoked by newDocument() ) over and over > >>>>again, and there's simply no reference to SOAP exception anywhere in my > >>>>processing thread. It appears only one time in the entire class, in > >>>>method getEncoding(), which cannot possibly be invoked downstream of > >>>>newDocument(). And anyway, it's certainly not one of the three > >>>>exceptions thrown by newDocument(). > >>>> > >>>>Something weird is going on here. Here is the stack trace returned by > >>>>Tomcat when I invoke the servlet. > >>>> > >>>>java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException > >>>> Proxy.ProxyServlet.handleHtmlFile(ProxyServlet.java:94) > >>>> Proxy.ProxyServlet.doGet(ProxyServlet.java:55) > >>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > >>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > >>>> > >>>>ProxyServlet is my code, and line 94 reads > >>>> > >>>>Document doc = XMLUtils.newDocument(conn.getInputStream()) > >>>> > >>>>conn is an instance of HttpURLConnection that was returned by > >>>>url.openConnection(), where url is an instance of URL initialized to a > >>>>valid url value. > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >>> > > > > > > > > > -- Davanum Srinivas - http://webservices.apache.org/~dims/
