Fwd: Barracuda: Document from JTidy and NullPointerException
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
>From: Jinhua Fan <[email protected]> >To: "'[email protected]'" <[email protected]> >Date: Fri, 28 Mar 2003 17:39:50 -0500 > >Hi Adam, > >I was searching the Goggle for the help on import Node( node, boolean) call >that generates a NullPointerException. I was doing the same as you >described in your original message (see below) using JTidy converting an >HTML to XML document and try to add some node to a new Document. > >I am wondering whether you have find a solution to the problem since I >cannot find any thread or your message. If you have solved the problem, >would you mind to give me some direction on how you did it? > >Thank you very much. > >Jinhua > > > > >**************** Your original message below *************************** >Hi all, > >I am getting the following stack trace while trying to import a node = >that I have dynamically extracted from an html page using JTidy. > >This is the bit of code which is in a model: > > Node node =3D item.getNode(); > Document doc =3D = >getViewContext().getElementFactory().getDocument(); > node =3D doc.importNode( node, true ); > Element td =3D doc.getElementById("webhook"); > if ( td !=3D null ) > { > td.removeAttribute("id"); > td.appendChild( node ); > return new BComponent(); > } > >The NullPointerException originates from the importNode call.=20 > >Any ideas? Can I import a node that I have extracted using JTiday into a = >document that was compiled with XMLC and is using the lazy dom? > >Cheers, > >Adam. > >Jinhua Fan >_______________________________________________ >Barracuda mailing list >[email protected] >http://www.enhydra.org/mailman/listinfo.cgi/barracuda >FAQ - http://www.jguru.com/faq/Barracuda