Re: Fwd: Barracuda: Document from JTidy and NullPointerException

Jacob Kjome <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
One thing you can do is to load plain html files quite easily with XMLC's 
XMLCContext.  See info on that here...
http://xmlc.enhydra.org/project/mailingLists/xmlc/msg02204.html

Note that this functionality was added in XMLC-2.2alpha2.  You can grab 
XMLC-2.2 from Barracuda's CVS or the official alpha4 release from here:
http://debian-sf.objectweb.org/project/showfiles.php?group_id=49

The XMLC-2.2 jars in Barracuda's CVS are very slightly newer than 
alpha4.  They have fixes that will be in the next XMLC-2.2 release version.

Jake

At 10:17 AM 4/2/2003 +0100, you wrote:
>Hi Jinhua,
>
>I'm afraid I don't really remember doing this. I was probably just 
>investigating various techniques and I know that we don't use this 
>technique in any of our software, so I must assume that I was unsuccessful 
>in making it work. Others on this list are much more qualified to answer 
>the question of whether it is possible to import a Node of one 
>implementation (in this case JTidy) into a document of a different 
>implementation (in this case XMLC Lazy DOM). My guess is that it is not 
>straightforward.
>
>regards,
>
>Adam.
>>----- Original Message -----
>>From: <mailto:[email protected]>Jacob Kjome
>>To: <mailto:[email protected]>[email protected]
>>Sent: Tuesday, April 01, 2003 7:01 PM
>>Subject: [Barracuda] Fwd: Barracuda: Document from JTidy and 
>>NullPointerException
>>
>>
>>
>>>From: Jinhua Fan <<mailto:[email protected]>[email protected]>
>>>To: "<mailto:'[email protected]'>'[email protected]'" 
>>><<mailto:[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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.