Bug #2888
closedStatic base-uri for in-browser exported stylesheets.
100%
Description
Currently the export format contains baseUri="path"
attributes which are used to recover the static base URI at run time. These refer to the location of the defining stylesheet at compile time. In cases where the exported stylesheet is being run in browser under Saxon-JS, this is inappropriate, as usually the export is loaded via HTTP and far removed from its original location.
Under Saxon-JS Context.fixed
now has three additional properties which are set during initialisation:
-
staticBaseURI
- which is the absolute URI of the export file loaded via the stylesheetLocation option. This is now used to recover 'stylesheet-relative' resources e.g. @select="doc('myResources.xml')"@, assuming any HTTP server URL resolution is configured suitably. -
htmlURI
- the absolute URI of the html document that invoked Saxon-JS -
javascriptURI
- the absolute URI of the javascript (i.e. Saxon-JS). This is used to dynamically load additional resources, such as the regular expression categories.
In execution outside the browser, static base URI is still recovered from attributes in the export file.
Changes committed to the Saxon-JS code.
Updated by Michael Kay over 8 years ago
- Status changed from Resolved to In Progress
Leaving open because I think there are some wider issues.
I have changed the ExpressionPresenter to use a configuration option FeatureKeys.EXPORT_BASE_URI, if set false, the static base URI is not written to the export file. The option is set false automatically when target:JS is used.
I have also changed it to output the "module" attribute (used when reporting dynamic errors) in truncated form if EXPORT_BASE_URI is false. Only the last part of the path is output.
Updated by Michael Kay about 8 years ago
- Status changed from In Progress to Resolved
This appears to have been resolved (though no doubt there will be further problems in this area...)
Updated by Debbie Lockett about 8 years ago
Further commits made to the Saxon-JS code, and 9.8 code.
From 9.8, it is possible to control whether an SEF is "relocatable". If an SEF is relocatable, this means it contains no local base URI information (in attributes such as @baseUri). This control is independent to setting the target edition (for instance to "JS"). The attribute @relocatable (with value "true"or "false") is added to the package element of an SEF to indicate this setting.
The configuration option FeatureKeys.EXPORT_BASE_URI has been removed, and replaced by the property "relocatable" (in CompilerInfo, ExpressionPresenter, and PackageData).
When running the XsltTestSuiteDriverJS (in Nashorn) this can be controlled using the option -relocatable:on|off.
When running outside the browser, if relocatable is true, then the stylesheetFileName is used for the Context.fixed.staticBaseUri.
Updated by Debbie Lockett almost 8 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Found in version set to 0.9
- Fixed in version set to 0.9.1
Bug fix applied in the Saxon-JS 0.9.1 beta release.
Updated by Community Admin over 7 years ago
- Fixed in JS Release set to Saxon-JS 0.9.1
- Applies to JS Branch 0.9 added
- Fix Committed on JS Branch 0.9 added
Updated by Debbie Lockett over 7 years ago
- Description updated (diff)
- Applies to branch deleted (
9.8)
Please register to edit this issue
Also available in: Atom PDF Tracking page