| Author |
JAXP XSLT transform to DOMResult failure
|
M Galevsky
Greenhorn
Joined: Mar 05, 2008
Posts: 10
|
|
Hi all, I am running the following code well: [...] StreamResult fileResult= new StreamResult(outputFile); Transformer transformer = xmlWritter.newTransformer(new javax.xml.transform.stream.StreamSource("./my_sheet.xsl")); transformer.transform(new DOMSource(dom), fileResult); [...] it generates the outputFile as expected. Now, I would like to get a DOMResult instead: [...] DOMResult domResult= new DOMResult(); Transformer transformer = xmlWritter.newTransformer(new javax.xml.transform.stream.StreamSource("./my_sheet.xsl")); transformer.transform(new DOMSource(dom), domResult); [...] But execution fails on : ERREUR : 'HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. ' Anyone can help ? Thks very much, Gal'
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
My guess is that your XSL produces something that isn't an XML document. This doesn't matter when you are writing to a file, but you can't produce a DOM unless your output is a well-formed XML document. Most likely your output doesn't have a single root element, but I suppose there are other possibilities.
|
 |
 |
|
|
subject: JAXP XSLT transform to DOMResult failure
|
|
|