To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=97173
                 Issue #|97173
                 Summary|Unable to use same XML Filter twice without restarting
                        | OpenOffice
               Component|xml
                 Version|OOo 3.0
                Platform|PC
                     URL|
              OS/Version|Windows XP
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P2
            Subcomponent|external filters
             Assigned to|jsi
             Reported by|gkholman





------- Additional comments from gkhol...@openoffice.org Fri Dec 12 02:40:08 
+0000 2008 -------
I'll attach an export filter named Ken-Test-Write.jar.  This is a filter that 
creates more than one result.  My production version creates a single text 
report file as the main output and dozens of supplemental files using XSLT 2 
<xsl:result-document>.

This is the stylesheet you'll find:

<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                xmlns:c="urn:X-Crane"
                exclude-result-prefixes="xsd c"
                version="2.0">

<xsl:output method="text"/>

<xsl:template match="/">
  <xsl:result-document href="file:///c:/ken-test-write-problem.txt">
Hopefully this will start working more than once soon! <xsl:value-of 
  select="format-dateTime(adjust-dateTime-to-timezone(
            current-dateTime(),xsd:dayTimeDuration('PT0H')),
            '[Y0001]-[M01]-[D01] [H01]:[m01]z')"/>
  </xsl:result-document>
  This is a successful run of the write stylesheet: <xsl:value-of 
  select="format-dateTime(adjust-dateTime-to-timezone(
            current-dateTime(),xsd:dayTimeDuration('PT0H')),
            '[Y0001]-[M01]-[D01] [H01]:[m01]z')"/>
</xsl:template>

</xsl:stylesheet>


When I use the export filter to create a result, the first time through works 
just fine.  I get both the "main" output file and the "supplemental" output 
file created using <xsl:result-document>.

The second and subsequent attempts to write the file fail with the error:

  Error saving the document Untitled 1: 
  Write Error. 
  The file could not be written.

The error log indicates that it because Saxon still thinks the first 
transformation has not been completed:


t:\>type t:\oo3-xslt-log.txt
The transformation's parameters as 'name = value' pairs:

StylesheetURL = file:///Z:/data/kendata/dev/OOo/bugs/ken-test-write.xsl
TargetURL = file:///t:/k2.txt
DoctypeSystem =
TargetBaseURL = file:///t:/


Starting transformation...
net.sf.saxon.trans.XPathException: Cannot write more than one result document 
to the same URI, or write to a URI that has been read: file:/c:/ken-test-write-
problem.txt
; SystemID: file:///Z:/data/kendata/dev/OOo/bugs/ken-test-write.xsl; Line#: 11;
Column#: -1
net.sf.saxon.trans.XPathException: Cannot write more than one result document 
to the same URI, or write to a URI that has been read: file:/c:/ken-test-write-
problem.txt
        at net.sf.saxon.instruct.ResultDocument.processLeavingTail
(ResultDocument.java:351)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:409)
        at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:175)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates
(ApplyTemplates.java:343)
        at net.sf.saxon.Controller.transformDocument(Controller.java:1736)
        at net.sf.saxon.Controller.transform(Controller.java:1560)
        at XSLTransformer$1.run(XSLTransformer.java:336)

t:\>


Exiting and restarting OpenOffice allows the export filter to work exactly one 
time once again, and again stops working until OpenOffice is stopped and 
restarted.

Hopefully you'll find a way to totally reset Saxon before each export task so 
that all export tasks are allowed to open any file.

Note that I am not trying to open the same file twice in one execution of the 
stylesheet ... I know that is not allowed ... I am only trying to write the 
same file once with each export, so I need Saxon to be completely reset before 
each export.

Thanks!  Again, any questions please ask:  gkhol...@cranesoftwrights.com

. . . . . . . . . . . . Ken

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@xml.openoffice.org
For additional commands, e-mail: issues-h...@xml.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to