You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Boris Garbuzov <bo...@borealissoft.com> on 2001/05/12 08:48:19 UTC

reload document

I tried and failed to complete my plan. What is the proper way to either
directly reload the document or to fully import the content from new
document?

----------------
           Document newDocument = docBuilder.parse (file);
            Element newRoot = newDocument.getDocumentElement();
            Element oldRoot = getDocument().getDocumentElement();
            // NullPointerException
            cassDocument.removeChild (oldRoot);
            boolean isDeep = true;
            cassDocument.importNode (newRoot, isDeep);
            cassDocument.appendChild (newRoot);
-----------------------



Can I reload document and how to do it easier? I want to keep the same
instance. It failed with JAXP transformer. I am using Xalan-Xerces. If I

say
document = documentBuilder.parse (file);
it will create new document instance. May be I can create this new
instance and then inport its content into old one?

Boris.




RES: reload document

Posted by Marcos Aurélio Alves <aa...@w3vd.com.br>.
Why don't you try this...

----------------
           Document newDocument = docBuilder.parse (file);
            Element newRoot = newDocument.getDocumentElement();
            Element oldRoot = cassDocument.getDocumentElement();
            // NullPointerException
            cassDocument.removeChild (oldRoot);
            boolean isDeep = true;
            cassDocument.appendChild (cassDocument.importNode (newRoot,
isDeep));
-----------------------

Marcos.


-----Mensagem original-----
De: Boris Garbuzov [mailto:boris.garbuzov@borealissoft.com]
Enviada em: sábado, 12 de maio de 2001 03:48
Para: undisclosed-recipients:;
Assunto: reload document


I tried and failed to complete my plan. What is the proper way to either
directly reload the document or to fully import the content from new
document?

----------------
           Document newDocument = docBuilder.parse (file);
            Element newRoot = newDocument.getDocumentElement();
            Element oldRoot = getDocument().getDocumentElement();
            // NullPointerException
            cassDocument.removeChild (oldRoot);
            boolean isDeep = true;
            cassDocument.importNode (newRoot, isDeep);
            cassDocument.appendChild (newRoot);
-----------------------



Can I reload document and how to do it easier? I want to keep the same
instance. It failed with JAXP transformer. I am using Xalan-Xerces. If I

say
document = documentBuilder.parse (file);
it will create new document instance. May be I can create this new
instance and then inport its content into old one?

Boris.