Title: Message
Hi David
 
Actually that constructor looks wrong; it allows you to create a DOMDocument which contains any old Element whereas it should probably restrict to just DOMElement objects.
 
I'll patch the constructor. I'd recommend using the DOMWriter anyways, then you can handle any dom4j document, whether it supports DOM natively or not. (DOMWriter is optimized to detect native DOMDocuments).

James
----- Original Message -----
Sent: Saturday, April 13, 2002 2:55 AM
Subject: RE: [dom4j-user] Passing parameters to xslt

This won't work?
 
    DOMDocument domDoc = new DOMDocument(paramDoc);
 
Where paramDoc is a dom4j Element?

-----Original Message-----
From: James Strachan [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2002 8:39 PM
To: David Hooker; [EMAIL PROTECTED]
Subject: Re: [dom4j-user] Passing parameters to xslt

Saxon will probably expect the parameter to be a DOM node so you can use DOMWriter (in org.dom4j.io) to create a W3C DOM node.
 
e.g.
 
Document doc = ...;
 
DOMWriter writer = new DOMWriter();
org.w3c.dom.Document domDoc = writer.write ( doc );
 
 
You can also use a DOMDocumentFactory (in org.dom4j.dom) to create dom4j documents which are also W3C DOM trees as well - though this DOM implementation still needs a bit more work to be fully conformant so the above is probably the safest option for now.

James
----- Original Message -----
Sent: Friday, April 12, 2002 11:15 PM
Subject: [dom4j-user] Passing parameters to xslt

I need to pass a dom4J Document to an xslt transformation as an xslt parameter.  I'm using Saxon.  Does anyone know if I can just pass the dom4J Document object  using Transformer.setParameter() from TrAX, or do I have to convert it into a w3c DOM first?
 
Also, how do I convert a dom4j Document into a w3c DOM?

Reply via email to