Project

Profile

Help

Bug #1853

closed

"jar" URIs no longer supported in 9.5

Added by Romain Deltour over 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
-
Start date:
2013-07-23
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Trying to import a stylesheet packaged in a Jar file from another stylesheet in the same jar raises an exception in Saxon 9.5.x. It worked in Saxon 9.4.x. The change of behavior doesn't seem to be documented in the release notes.

Attached is a jar to reproduce the error, along with a ZIP containing the sources of the jar.

With Saxon 9.5:

$ java -cp Saxon-HE-9.5.0.1.jar:xslt-0.0.1-SNAPSHOT.jar org.example.Main
Warning: on line 8 of main.xsl:
  Evaluation will always throw a dynamic error: Base URI {jar:file:/Users/Romain/Work/ec...}
  is a non-hierarchic URI
Error on line 8 of main.xsl:
  FORG0002: Base URI {jar:file:/Users/Romain/Work/ec...} is a non-hierarchic URI
net.sf.saxon.s9api.SaxonApiException: Base URI {jar:file:/Users/Romain/Work/ec...} is a non-hierarchic URI
	at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:454)
	at org.example.Main.main(Main.java:23)
Caused by: net.sf.saxon.trans.XPathException: Base URI {jar:file:/Users/Romain/Work/ec...} is a non-hierarchic URI

With Saxon 9.4:

$ java -cp Saxon-HE-9.4.0-9.jar:xslt-0.0.1-SNAPSHOT.jar org.example.Main
<?xml version="1.0" encoding="UTF-8"?><uri>jar:file:/Users/Romain/Work/eclipse/workspaces/maven-plugin/xslt/target/xslt-0.0.1-SNAPSHOT.jar!/xslt/imported.xsl</uri>

This can be worked around by setting a System ID to the source with a custom URI and associating a URIResolver that parse this URI and loads the resource from the Jar.


Files

xslt-0.0.1-SNAPSHOT.jar (3.24 KB) xslt-0.0.1-SNAPSHOT.jar Romain Deltour, 2013-07-23 02:47
saxon-jar-uri.zip (3.3 KB) saxon-jar-uri.zip Romain Deltour, 2013-07-23 02:47

Please register to edit this issue

Also available in: Atom PDF