Bug #2345
closedTransformation failed: Error opening packaged stylesheet file or Invalid URI for stylesheet
100%
Description
I have determined that java net.sf.saxon.Transform -s:source -xsl:stylesheet -o:output is broken (or at least significantly different) starting in 9.6.0.1 when the following conditions are met:
-
stylesheet is packaged by com.saxonica.ptree.StylesheetPackager
-
the resulting output of the packager is a file whose name contains whitespace
-
the -xsl argument is encoded as a URI (one type of error) or it is not encoded as a URI (another type of error)
To test this, I have created a test.sh (attached). I have created two directories, one for each version of saxonica. Each directory contains pe, he, unpack, and a license. The script creates an xsl transform file, an xml input file, and then loops over each version. For each version it compiles the xsl and executes it. If the execution fails, it tries to encode the xsl as a uri and then tries again.
Below is my console output showing how 9.5.1.8 is ok but 9.6.0.1 is not.
17:09:31 $ sh test.sh
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)
rw-r--r- 1 jholt wheel 280 Mar 31 17:09 /tmp/t est.zip
total 44176
-rw-r--r--+ 1 jholt staff 338 Mar 31 17:03 saxon-license.lic
-rw-r--r--+ 1 jholt staff 20831 Oct 31 16:01 saxon9-unpack.jar
-rw-r--r--+ 1 jholt staff 10297682 Oct 31 16:02 saxon9he.jar
-rw-r--r--+ 1 jholt staff 12286131 Oct 31 16:02 saxon9pe.jar
SAXON 9.5.1.8 from Saxonica (build 103109)
SAXON 9.5.1.8 from Saxonica (build 103109)
Compiling
Transforming
hi
total 18000
-rw-r--r--+ 1 jholt staff 338 Mar 31 17:04 saxon-license.lic
-rw-r--r--+ 1 jholt staff 13425 Oct 2 22:09 saxon9-unpack.jar
-rw-r--r--+ 1 jholt staff 4161912 Oct 2 22:09 saxon9he.jar
-rw-r--r--+ 1 jholt staff 5025845 Oct 2 22:09 saxon9pe.jar
SAXON 9.6.0.1 from Saxonica (build 101022)
SAXON 9.6.0.1 from Saxonica (build 101022)
Compiling
Transforming
Error
Invalid URI for stylesheet: /tmp/t est.zip
Invalid URI for stylesheet: /tmp/t est.zip
Transforming again
Transformation failed: Error opening packaged stylesheet file file:///tmp/t%20est.zip
17:10:19 $
Files
Updated by Michael Kay over 9 years ago
- Status changed from New to In Progress
I think this is probably a duplicate of bug #2314 (different symptoms but the same underlying problem)
Updated by Michael Kay over 9 years ago
- Category set to Command Line
- Status changed from In Progress to Resolved
- Assignee set to Michael Kay
- Priority changed from Low to Normal
- Found in version set to 9.6
It turns out that the regression from 9.5 occurs because Saxon's evaluation of use-when expressions is now setting the base URI more rigorously, and in this case is failing because the base URI being used is not a valid URI. This is because the base URI set by the package URI resolver is the filename as supplied (with a space), not the result of converting the filename to a URI.
A patch to set the base URI correctly is being committed on the 9.6 and 9.7 branches.
Updated by O'Neil Delpratt over 9 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in version set to 9.6.0.6
Bug fix applied in the Saxon 9.6.0.6 maintenance release.
Updated by O'Neil Delpratt about 9 years ago
- Sprint/Milestone set to 9.6.0.6
- Applies to branch 9.6 added
- Fix Committed on Branch 9.6 added
- Fixed in Maintenance Release 9.6.0.6 added
Please register to edit this issue