[xep-support] FW: DOM element does not have an owner document: cannot determine DOM Level

Hamacher, Eric Eric_Hamacher at gallup.com
Tue Mar 3 08:03:57 PST 2009


Hello:

I am embedding XEP in a Java application which means I am using the APIs directly I my code, sort of like what the Formatter servlet does.     I am getting the following exception:

org.xml.sax.SAXException: DOM element does not have an owner document: cannot determine DOM Level
                at com.renderx.sax.DOMWalker.play(Unknown Source)
                at com.renderx.sax.XMLPlayer.parse(Unknown Source)
                at com.renderx.xep.FormatterCore.render(Unknown Source)
                at com.renderx.xep.FormatterImpl.render(Unknown Source)
                at com.renderx.xep.FormatterImpl.render(Unknown Source)
                at com.renderx.xep.FormatterImpl.render(Unknown Source)
                at com.gallup.fogen.PDFGenerator.transform(PDFGenerator.java:35)

at the following:

        FormatterImpl formatter = new FormatterImpl(confProps);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        Properties outputProps = new Properties();
        FOTarget target = new FOTarget(os, "PDF", outputProps);
        formatter.render(new DOMSource(foDocument),target);  //exception happens here

The code which produces the org.w3c.dom.Document named foDocument is here:

        Document fo = null;

       DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
       DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
       fo = docBuilder.newDocument();
       DOMResult domr = new DOMResult(fo);

       System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
       TransformerFactory tfactory = TransformerFactory.newInstance();
       Transformer transformer = tfactory.newTransformer(new DOMSource(xslt));
       transformer.transform(new DOMSource(xml),domr);
      return fo;

The DOM document has no owner. . . it is the entire document.  Any help would be appreciated!

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20090303/d59630ee/attachment.html>


More information about the Xep-support mailing list