Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Received: (qmail 94725 invoked from network); 3 Feb 2000 19:00:26 -0000 Received: from lotus2.lotus.com (192.233.136.8) by 63.211.145.10 with SMTP; 3 Feb 2000 19:00:26 -0000 Received: from internet2.lotus.com (internet2 [9.95.4.236]) by lotus2.lotus.com (8.9.3/8.9.3) with ESMTP id OAA03901 for ; Thu, 3 Feb 2000 14:15:30 -0500 (EST) Received: from a3mail.lotus.com (A3MAIL.lotus.com [9.95.5.66]) by internet2.lotus.com (8.9.3/8.9.3) with ESMTP id NAA04164 for ; Thu, 3 Feb 2000 13:59:57 -0500 (EST) Subject: RE: WRONG_DOCUMENT_ERR To: general@xml.apache.org X-Mailer: Lotus Notes Release 5.0 March 30, 1999 From: "Scott Boag/CAM/Lotus" Date: Thu, 3 Feb 2000 13:58:21 -0500 Message-ID: X-MIMETrack: Serialize by Router on A3MAIL/CAM/H/Lotus() at 02/03/2000 02:00:54 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Right, but this is definately a bug in Xalan. What he's trying to do should work fine. -scott "Truong, Bon" ish.com> cc: (bcc: Scott Boag/CAM/Lotus) Subject: RE: WRONG_DOCUMENT_ERR 02/03/00 01:55 PM Please respond to general The cause of the error message "WRONG_DOCUMENT_ERR" is that xmlSource and xmlTarget have different document nodes, instead of one common document node. Regards Bon -----Original Message----- From: Brian Dupras [mailto:briand@centera.com] Sent: Thursday, February 03, 2000 8:21 AM To: Xml-Apache (E-mail) Subject: WRONG_DOCUMENT_ERR I'm trying to track down a bug in my code, but i'm having some trouble. Any help is greatly appreciated. I've written the following function to transform an XML Element through an XSL Document, and store the results as children of another XML Element: public static void transformElement(Element xmlSource, Document xsl, Element xmlTarget) throws SAXException { XSLTProcessor xsltProcessor = XSLTProcessorFactory.getProcessor(new org.apache.xalan.xpath.xdom.XercesLiaison()); xsltProcessor.process( new XSLTInputSource(xmlSource), new XSLTInputSource(xsl.getDocumentElement()), new XSLTResultTarget(xmlTarget) ); } //transformElement However, I'm gettnig a WRONG_DOCUMENT_ERR. I'm not sure which part I'm doing wrong. Any clues from the above? For xmlSource, I'm passing an Element Node deep inside one document tree. For xmlTarget, I'm passing an Element Node that is owned by a different Document. xsl is a new Document that holds the xsl transform. the xsl: I'm getting this on the stderr: WRONG_DOCUMENT_ERR org.apache.xerces.dom.DOMExceptionImpl: WRONG_DOCUMENT_ERR at org.apache.xerces.dom.NodeImpl.internalInsertBefore(NodeImpl.java, Compiled Code) at org.apache.xerces.dom.NodeImpl.insertBefore(NodeImpl.java, Compiled Code) at org.apache.xerces.dom.NodeImpl.appendChild(NodeImpl.java, Compiled Code) at org.apache.xalan.xpath.xml.FormatterToDOM.append(FormatterToDOM.java:129) at org.apache.xalan.xpath.xml.FormatterToDOM.characters(FormatterToDOM.java:328 ) at org.apache.xalan.xslt.XSLTEngineImpl$ResultTreeHandler.characters(XSLTEngine Impl.java, Compiled Code) at org.apache.xalan.xslt.XSLTEngineImpl.cloneToResultTree(XSLTEngineImpl.java:1 810) at org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement .java:976) at org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp lateElement.java, Compiled Code) at org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:147 ) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:141) at org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java, Compiled Code) at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java, Compiled Code) at com.medwired.pp.XmlHelper.transformElement(XmlHelper.java:65) at com.medwired.pp.components.StaticStory.render(StaticStory.java:27) at jsp.medwired.pagetest.pagegen.renderComponent(pagegen.java:312) at jsp.medwired.pagetest.pagegen.renderComponents(pagegen.java, Compiled Code) at jsp.medwired.pagetest.pagegen._jspService(pagegen.java:130) at com.livesoftware.jsp.HttpJSPServlet.service(HttpJSPServlet.java:31) at com.livesoftware.jsp.JSPServlet.service(JSPServlet.java:118) at javax.servlet.http.HttpServlet.service(HttpServlet.java:840) at com.livesoftware.jrun.JRun.runServlet(JRun.java, Compiled Code) at com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric.java:116) at com.livesoftware.jrun.JRunGeneric.handleProxyConnection(JRunGeneric.java:78) at com.livesoftware.jrun.service.proxy.JRunProxyServiceHandler.handleRequest(JR unProxyServiceHandler.java:102) at com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadConfigHandler.ja va, Compiled Code) Brian Dupras Centera Information Systems, Inc. phone 303.939.0200 x294 fax 303.939.0111 web http://www.centera.com email briand@centera.com