You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Jim O'Neill <jp...@ibm.net> on 2000/01/04 16:32:35 UTC

processing in-memory document with XALAN

Hi,

I have an in-memory Document that I've created using DOMParser and have
manipulated it (i.e. added new nodes, set data, etc...). But, when I try to
use this Document with XALAN I get the following error:

"DTMLiaison can not handle nodes of typeclass
org.apache.xerces.dom.DeferredDocumentImpl"

Is there any way to get XALAN to process an in-memory, mutable, DOM? From
reading the docs, it looks like the DTM parser creates an "optimized"
Document and therefore some operations aren't allowed ... and XALAN appears
to require DTM Nodes.

Any help would be appreciated,
Jim


RE: processing in-memory document with XALAN

Posted by Scott Priddy <sp...@Globeset.com>.
When constructing your processor, pass in the XercesLiaison.

The processor returned by the factory uses the DTMLiaison. So instead of:
org.apache.xalan.xslt.XSLTProcessor processor =
	org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor();

try:
org.apache.xalan.xslt.XSLTProcessor processor =
	new org.apache.xalan.xslt.XSLTEngineImpl(new
org.apache.xalan.xpath.xdom.XercesLiaison());

This is the same issue the other person was having with the exception
throwing due to have the wrong liaison for DOM.  Perhaps the processor
interface could be extended to support changing the liaison, or changing the
factory to have it generate a processor with a particular liaision.

-Scott Priddy

> Hi,
>
> I have an in-memory Document that I've created using
> DOMParser and have
> manipulated it (i.e. added new nodes, set data, etc...). But,
> when I try to
> use this Document with XALAN I get the following error:
>
> "DTMLiaison can not handle nodes of typeclass
> org.apache.xerces.dom.DeferredDocumentImpl"
>
> Is there any way to get XALAN to process an in-memory,
> mutable, DOM? From
> reading the docs, it looks like the DTM parser creates an "optimized"
> Document and therefore some operations aren't allowed ... and
> XALAN appears
> to require DTM Nodes.
>
> Any help would be appreciated,
> Jim
>