xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Dupras <bri...@centera.com>
Subject RE: WRONG_DOCUMENT_ERR
Date Thu, 03 Feb 2000 19:10:14 GMT
The workaround worked.  Thanks.  :)


> -----Original Message-----
> From: Scott Boag/CAM/Lotus [mailto:Scott_Boag@lotus.com]
> Sent: Thursday, February 03, 2000 11:57 AM
> To: general@xml.apache.org
> Cc: xalan-dev@xml.apache.org
> Subject: Re: WRONG_DOCUMENT_ERR
> 
> 
> 
> I think it's because I'm having the parser liaison create a 
> document to use
> as the result tree factory object.  Yech.  Argh.  I ought to 
> at least have
> a setDOMFactory() method on the process, but for some reason 
> I only put in
> a getDOMFactory().  The &#*$^ DOM won't let you add a node to 
> one document
> that was created by another document.
> 
> The easiest workaround for this is to set the FormatterToDOM object
> yourself:
> 
>     public static void transformElement(Element xmlSource, 
> Document xsl,
> Element
>                                         xmlTarget)
>       throws SAXException
>     {
>       XSLTProcessor xsltProcessor
>         = XSLTProcessorFactory.getProcessor(new
> org.apache.xalan.xpath.xdom.XercesLiaison());
>       org.apache.xalan.xpath.xml.FormatterToDOM domMaker
>         = new
> org.apache.xalan.xpath.xml.FormatterToDOM(xmlTarget.getOwnerDo
> cument(),
>                                                         xmlTarget);
>       xsltProcessor.process(        new XSLTInputSource(xmlSource),
>                                  new 
> XSLTInputSource(xsl.getDocumentElement
> ()),
>                                  new XSLTResultTarget(domMaker)
>                                  );
>     } //transformElement
> 
> Please let me know if this works around the problem for you or not.
> 
> BTW, in general I'm having a pretty hard time keeping up with 
> the mail on
> all the Apache lists.  You're a little better off sending 
> mail that relates
> to Xalan to the xalan dev list.
> 
> -scott
> 
> 

Mime
View raw message