Subject: [xsl] Re: Strange Saxon error From: Stephen Arbour <sarbour@xxxxxxxxx> Date: Thu, 15 Apr 2010 08:26:14 -0400 |
Thanks for the help, and sorry if this post should have been targeted at the Saxon forum instead. It does appear that the problem has to do with the strictness of the URI comparison changing from 9.1 to 9.2. Once we fixed that the problem was resolved. I do think the error is poorly worded, however, as it turned out the problem was the referenced document was unable to be found by the processor, rather than the reported error that we were violating the XSLT 2.0 rule that a stylesheet should not operate on a result document from the same stylesheet operation. Configuring an XSLT pipeline seems like a better option generally than what this particular XSLT is doing anyway. Best, Stephen Date: Wed, 14 Apr 2010 18:57:19 +0100 To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list@xxxxxxxxxxxxxxxxxxxxxx>> From: "Michael Kay" <mike@xxxxxxxxxxxx<mailto:mike@xxxxxxxxxxxx>> Subject: RE: [xsl] Strange Saxon error Message-ID: <65C186E4AD1549DAA7F06968F24C766E@Sealion> Please report Saxon-specific problems to the saxon-help list (or forum) available via the saxon project at sourceforge.net<http://sourceforge.net>. Writing a document using xsl:result-document and reading the same document using document() or doc() is not allowed by the XSLT 2.0 specification. Note that there is no such thing as an "earlier step in the same XSL" - the order in which instructions are evaluated is not defined, so there is no way of knowing whether the read comes before the write, or after it: this is the reason for this rule. It's possible that Saxon 9.2 is enforcing the rule more rigorously than Saxon 9.1 did, for example it may be better at recognizing the equivalence of similar URIs. (However, if you try hard enough you can always find URIs for reading and writing that are sufficiently different that Saxon won't recognize that they actually refer to the same resource, and you can thereby circumvent the rule. You just have to take the consequence that you can't be 100% sure whether you are reading the document before or after writing it.) It's also possible that the error is spurious: there's a recent bug with these symptoms, see https://sourceforge.net/tracker/?func=detail&aid=2986119&group_id=29872&atid =397617. But from your description, it looks as if the stylesheet is doing what the spec doesn't allow. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay -----Original Message----- From: Stephen Arbour [mailto:sarbour@xxxxxxxxx] Sent: 14 April 2010 18:29 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Strange Saxon error Hi all, We have a customer that was using Saxon 9.1.0.7j using an XSLT transform that was created by a third party. When they upgraded to a version that uses Saxon 9.2.0.2, they started receiving this error: net.sf.saxon.trans.XPathException: Cannot read a document that was written during the same transformation: file:/C:/Program%20Files/K4%20XML%20Exporter/data/xsl/temp/21m issouri4.xml However, using the same XSLT in Oxygen 11 using 9.2.0.6 (HE, PE), I can't recreate the error. It only appears when Saxon is called by the application we support. The XSL itself does indeed perform operations on files created by earlier steps in the same XSL. Is this no longer a supported workflow, but somehow Oxygen is intervening where the standalone Saxon jars do not? Thanks in advance for your help! Stephen Arbour, MBA/TM Senior Director of Product Management MEI 610 Old York Road, Suite 250, Jenkintown, PA 19046 Phone: 215-886-5662 x291 Fax: 215-886-5681 Email: sarbour@xxxxxxxxx<mailto:sarbour@xxxxxxxxx> <mailto:LBruce@xxxxxxxxx>AIM: sarbourmei http://www.maned.com<http://www.maned.com/> ------------------------------ Date: Wed, 14 Apr 2010 13:58:22 -0400 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx From: Liam R E Quin <liam@xxxxxx> Subject: Re: [xsl] Strange Saxon error Message-ID: <1271267902.11116.200.camel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> On Wed, 2010-04-14 at 13:29 -0400, Stephen Arbour wrote: Hi all, We have a customer that was using Saxon 9.1.0.7j using an XSLT transform that was created by a third party. When they upgraded to a version that uses Saxon 9.2.0.2, they started receiving this error: You might find the saxon mailing list more appropriate. net.sf.saxon.trans.XPathException: Cannot read a document that was written during the same transformation: file:/C:/Program%20Files/K4%20XML%20Exporter/data/xsl/temp/21missouri4.xml Sounds right to me. You might want to consider (1) holding the document's contents in a variable so you don't need to read it again, (2) running XSLT twice, (3) reworking the transformation so you don't need to re-read values you already computed... e.g. you may find that recomputing them is perfectly fast enough. Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org www.advogato.org
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] how to decode Base64 in X, Mukul Gandhi | Thread | [xsl] Sum of values from XML, Tom T |
Re: [xsl] how to decode Base64 in X, Mukul Gandhi | Date | Re: [xsl] how to decode Base64 in X, Florent Georges |
Month |