Thanks Michael,
 
I'll analyze this further since I had some problems but not really sure what causes them.
Essentially, if I use the document, I get the following error:
 

Error at element constructor <resultRoot> on line 1048575
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node
where it is not permitted.

This may be just some syntax omission on my side - I'll look at it more.

 

Milan

-----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Michael Kay
Sent: Wednesday, October 06, 2004 16:09
To: saxon-help@lists.sourceforge.net
Subject: RE: [saxon] DOMResult structure

No, you should be able to create a Document, wrap it in a DOMResult, and supply that as the result for the transformation. There's an example of this in the TraxExamples application.
 
Michael Kay
http://www.saxonica.com/


From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Milan Trninic
Sent: 06 October 2004 23:17
To: saxon-help@lists.sourceforge.net
Subject: [saxon] DOMResult structure

Hi,
 
Is it true that if I want to get the transformation result in a non-saxon DOM tree, I have to supply the element, like so:
 
Document doc = //obtain document//
Element element = doc.getDocumentElement();
DOMResult result = new DOMResult(element);
 
and not the document itself, like so:
 
DOMResult result = new DOMResult(doc);
 
I want to avoid the extra root element in the result because the transformation itself creates the result exactly as it should be.
 
Thanks
 
Milan