Thanks a lot, Mike, for this -out of the text- explanations !

Regards,
Christophe

On 13/09/2010 17:13, Michael Kay wrote:

What is happening here is that a failure occurs when using a DOMResult because the stylesheet is creating a text node as a child of a document node, and DOM does not allow this. The XDM model does allow it (if the text node is whitespace, as here, it will be output as ignorable whitespace by the serializer; if it is not whitespace, the serializer will output a file that is not a well-formed XML document, but is still a well-formed external entity.)

As often happens, the JAXP DOMResult specification gives no clues as to how the processor should deal with this situation.

In your case it can easily be prevented by stripping whitespace text nodes from the source using xsl:strip-space.

Michael Kay
Saxonica

On 10/09/2010 2:31 PM, Christophe Marchand wrote:
Oops : the other test-case is
java -jar lib/saxon9.jar -xsl:src/report.xsl src/data.xml
And this one works perfectly without uncommenting line #155 of report.xsl

Regards,
Christophe

On 10/09/2010 15:19, Christophe Marchand wrote:
Hi Michael,

A complete test-case is available at 
http://odm-budgetaire.org/private/test-case-xom.zip. Un-comment line 
#155 in src/report.xsl to make it run correctly.

There is no private data into this, feel free to use it as you need.

Best regards,
Christopĥe

On 10/09/2010 12:07, Michael Kay wrote:
  
   I'd be grateful if you could supply the source data enabling this to
be reproduced.

There may be legitimate reasons why different models produce different
results in edge cases (the DOM model is not the same as the XDM model,
and the mappings are not always perfect), but it would be nice to see
the detail.

Michael Kay
Saxonica

On 10/09/2010 9:37 AM, Christophe Marchand wrote:
   
    
Hi !

I have to transform one XML throw one XSL.

When using saxon9.jar on command line (well, in oXygen, but it's
equivalent), it works correctly.
In my code, using Xom model, writing to a DOMResult, I encounter this
exception :

In the same code, I apply many XSL to the same source XML, using always
DOMResults and Xom for source without problems. I may publish my XML and
my XSL if it helps.

Thanks a lot in advance,
Christophe

Error
     org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made
to insert a node
     where it is not permitted.
ERROR [cp.print.DocBudgPrinter] main: while applying etatRapport.xsl
net.sf.saxon.trans.XPathException: org.w3c.dom.DOMException:
HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is
not permitted.
           at net.sf.saxon.dom.DOMWriter.characters(DOMWriter.java:188)
           at
net.sf.saxon.event.ProxyReceiver.characters(ProxyReceiver.java:182)
           at
net.sf.saxon.event.ComplexContentOutputter.characters(ComplexContentOutputter.java:159)
           at
net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:388)
           at
net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:333)
           at
net.sf.saxon.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:527)
           at
net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:317)
           at
net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:378)
           at
net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:333)
           at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
           at net.sf.saxon.Controller.transform(Controller.java:1621)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.transformDocumentMultiDocument(DocBudgPrinter.java:363)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.prepareTransformDocument(DocBudgPrinter.java:208)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.generatePDF(DocBudgPrinter.java:184)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.run(DocBudgPrinter.java:469)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.main(DocBudgPrinter.java:458)
Caused by: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt
was made to insert a node where it is not permitted.
           at
com.sun.org.apache.xerces.internal.dom.ParentNode.internalInsertBefore(ParentNode.java:393)
           at
com.sun.org.apache.xerces.internal.dom.ParentNode.insertBefore(ParentNode.java:321)
           at
com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:427)
           at
com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(NodeImpl.java:275)
           at net.sf.saxon.dom.DOMWriter.characters(DOMWriter.java:185)
           ... 15 more
---------
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to
insert a node where it is not permitted.
           at
com.sun.org.apache.xerces.internal.dom.ParentNode.internalInsertBefore(ParentNode.java:393)
           at
com.sun.org.apache.xerces.internal.dom.ParentNode.insertBefore(ParentNode.java:321)
           at
com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:427)
           at
com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(NodeImpl.java:275)
           at net.sf.saxon.dom.DOMWriter.characters(DOMWriter.java:185)
           at
net.sf.saxon.event.ProxyReceiver.characters(ProxyReceiver.java:182)
           at
net.sf.saxon.event.ComplexContentOutputter.characters(ComplexContentOutputter.java:159)
           at
net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:388)
           at
net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:333)
           at
net.sf.saxon.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:527)
           at
net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:317)
           at
net.sf.saxon.instruct.ApplyTemplates.defaultAction(ApplyTemplates.java:378)
           at
net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:333)
           at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
           at net.sf.saxon.Controller.transform(Controller.java:1621)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.transformDocumentMultiDocument(DocBudgPrinter.java:363)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.prepareTransformDocument(DocBudgPrinter.java:208)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.generatePDF(DocBudgPrinter.java:184)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.run(DocBudgPrinter.java:469)
           at
fr.gouv.finances.cp.print.DocBudgPrinter.main(DocBudgPrinter.java:458)


------------------------------------------------------------------------------
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful,
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance.
http://p.sf.net/sfu/dell-sfdev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help

     
      
------------------------------------------------------------------------------
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful,
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance.
http://p.sf.net/sfu/dell-sfdev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help

   
    

------------------------------------------------------------------------------
Automate Storage Tiering Simply
Optimize IT performance and efficiency through flexible, powerful, 
automated storage tiering capabilities. View this brief to learn how
you can reduce costs and improve performance. 
http://p.sf.net/sfu/dell-sfdev2dev
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help 

------------------------------------------------------------------------------ Automate Storage Tiering Simply Optimize IT performance and efficiency through flexible, powerful, automated storage tiering capabilities. View this brief to learn how you can reduce costs and improve performance. http://p.sf.net/sfu/dell-sfdev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help