From briand@centera.com Thu Feb 3 19:10:15 2000 Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 97438 invoked from network); 3 Feb 2000 19:10:15 -0000 Received: from mail.centera.com (HELO mikasa.centera.com) (204.144.157.10) by 63.211.145.10 with SMTP; 3 Feb 2000 19:10:15 -0000 Received: by mail.centera.com with Internet Mail Service (5.0.1460.8) id <1HHJRH8F>; Thu, 3 Feb 2000 12:10:14 -0700 Message-ID: From: Brian Dupras To: "'general@xml.apache.org'" Subject: RE: WRONG_DOCUMENT_ERR Date: Thu, 3 Feb 2000 12:10:14 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain 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 > >