Re: Fwd: Barracuda: Document from JTidy and NullPointerException

"Adam J Chesney" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <004a01c2f8f8$bfcfa6f0$1b9dbdc0@zultan>
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: Jacob Kjome 
  To: [email protected] 
  Sent: Tuesday, April 01, 2003 7:01 PM
  Subject: [Barracuda] Fwd: Barracuda: Document from JTidy and NullPointerException





    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
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.