Project

Profile

Help

Bug #4471

closed

Base URI of configuration file supplied to fn:transform()

Added by Michael Kay about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT 3.0 packages
Sprint/Milestone:
-
Start date:
2020-03-02
Due date:
% Done:

100%

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

Description

From saxon-help mailing list:

When I have config.xml like this

  <configuration xmlns="http://saxon.sf.net/ns/configuration">
     <xsltPackages>
        <package name="http://example.org/package.xsl" sourceLocation="../package/package.xsl"
           version="1.0" />
     </xsltPackages>
  </configuration>

and provide it to fn:transform() like this

  <xsl:variable name="config" select="doc('../config/config.xml')" />
  <xsl:variable as="map(*)" name="options"
     select="
        map {
           'stylesheet-location': '../use-package/use-package.xsl',
           'initial-template': xs:QName('xsl:initial-template'),
           'vendor-options':
              map {
                 QName('http://saxon.sf.net/', 'configuration'): $config
              }
        }" />
  <xsl:sequence select="transform($options)?output" />

then @sourceLocation in the config is not resolved as relative to config.xml. (but to the current directory? it seems)

Could this be improved? Otherwise I'll have to fix up every URI in the config dynamically...

Actions #1

Updated by Michael Kay about 4 years ago

The code to read configuration files accepts the input as a SAX ContentHandler in the form of push events, and relies on the SAX event supplier (normally an XMLReader) to supply location information including the base URI. For fn:transform the configuration file is an in-memory document tree, we're stripping down the NodeInfo into a sequence of SAX events using the ContentHandlerProxy class, and I don't believe this is calling ContentHandler.setDocumentLocator, which means that the base URI is unknown.

Actions #2

Updated by Michael Kay about 4 years ago

Test case xslt30-extra/transform/transform-100 created.

Actions #3

Updated by Michael Kay about 4 years ago

  • Status changed from New to Resolved
  • Applies to branch 9.9, trunk added

Fixed.

Actions #4

Updated by O'Neil Delpratt about 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.9.1.7 added

Patch applied in the 9.9.1.7 maintenance release.

Please register to edit this issue

Also available in: Atom PDF