Project

Profile

Help

single xsl:result-document writes file twice

Added by Anonymous over 17 years ago

Legacy ID: #4079050 Legacy Poster: tom1301 (tom1301)

Hi there, i have a Problem with Saxon 8.8 run via ant-xslt-task on Windows XP. Obviously a single <xsl:result-document/> yields TWO files (besides the main result file, of course). I have build a simple XSL to demonstrate the Problem: ... <xsl:template match="/"> <xsl:value-of select="seconds-from-time(current-time())"/> <xsl:result-document href="{seconds-from-time(current-time())}.jrxml"/> </xsl:template> Executing this XSL on a suited XML ('test.xml' for example) yields the following files: - 'test.jrxml' - '6.165.jrxml' - '6.493.jrxml' The File 'test.jrxml' contains (as expected) only one line: <?xml version="1.0" encoding="UTF-8"?>6.493 Why are there TWO files produced by the single xsl:result-document? Since 'test.jrxml' contains only the '6.493', the xsl:value-of obviously yields exactly one result, whereas xsl:result-document yields two. Any help is greatly appreciated. tom1301. P.S.: Of course omitting the time-function leads to the infamous "Cannot write more than one result document to the same URI, or write to a URI that has been read" error, which is the real problem i have. Appendix: The Ant Task: <xsltstyle="${layout.generation.jsp.dir}/root.xsl" basedir="${test.source.dir}/xml" destdir="${test.target.jsp.dir}" extension=".jsp" force="true" processor="trax" classpathref="saxon.class.path"> </xslt>


Replies (2)

RE: single xsl:result-document writes file tw - Added by Anonymous over 17 years ago

Legacy ID: #4079134 Legacy Poster: Michael Kay (mhkay)

Since several calls on current-time() during the same transformation produce the same result, I would think the explanation is almost certainly that you have run the transformation more than once and it has produced different output files on each occasion. This would suggest the problem is at the Ant level.

RE: single xsl:result-document writes file tw - Added by Anonymous over 17 years ago

Legacy ID: #4079174 Legacy Poster: tom1301 (tom1301)

You are right, Michael. Without knowing your reply i tried meanwhile several solutions and workarounds and finally figured out the cause was the 'force="true"'-Parameter declared in the Ant-xslt-task. Omitting this parameter lets Saxon behave as expected. That fault gave me 6 hours of frustration. Well, at least i got it finally.... Thank you very much, nevertheless. tom1301

    (1-2/2)

    Please register to reply