PhoenixmlDb.XSLT

VendorOptionPackages

Extracts XSLT package declarations from the vendor-options map of fn:transform.

#VendorOptionPackages

Namespace: PhoenixmlDb.Xslt

Extracts XSLT package declarations from the

vendor-options

map of

fn:transform

.

XSpec declares package locations the only way Saxon offers — a configuration listing

xsltPackages/package/@name

and

@sourceLocation

— and passes it to fn:transform under

vendor-options

. Both fn:transform implementations ignored it, so

xsl:use-package name="http://example.org/complex-arithmetic.xsl"

could not resolve and raised XTDE3052 "Package not found" on five XSpec suites. This lives in one place because there are TWO fn:transform implementations —

XsltTransformProvider

for XQuery callers and

XsltTransformFunction

for XSLT ones — and fixing one of a pair while missing its twin has been the most common defect shape in this engine. The first attempt at this fix patched the XQuery-side provider only, and the failing suites go through the XSLT side.

vendor-options is the spec's own extension point (XPath and XQuery F&O, fn:transform): a map of implementation-defined options keyed by QName. Nothing in it is standardised, so a reader has to recognise some concrete vocabulary. The one in use is Saxon's configuration element, because that is what stylesheets in the wild — XSpec among them — actually write. Recognising a vocabulary is not implementing that processor: the engine's own package catalog does the work, and options in any other vocabulary are ignored rather than rejected.

#Methods

#AddNativePackages(Object,Uri,Collections.Generic.Dictionary<String,Collections.Generic.List<ValueTuple<String,String>>>@)

Reads the native

packages

map: package name -> location string, or -> a map with

location

and optional

version

.

#BuildCatalog(Collections.Generic.IDictionary<Object,Object>,Func<PhoenixmlDb.Xdm.Nodes.XdmNode,String>,Uri)

Builds a package catalog from any recognised package declarations in

, or

null

when there are none.

Parameters:

  • options — The fn:transform options map.

  • serialize — Serializes a node to XML; the two callers differ in how.

  • fallbackBaseUri — Used to resolve @sourceLocation when the configuration node carries no base URI. Locations are written relative to the CONFIG file, not to the stylesheet using the package.

#NamespaceOf(PhoenixmlDb.Core.QName)

The namespace URI a QName key actually carries.

fn:QName(uri, local)

populates

RuntimeNamespace

, so

ResolvedNamespace

is the property that holds the URI;

ExpandedNamespace

comes back EMPTY. Comparing the wrong one silently matched nothing, so a correctly written vendor option looked absent and the package stayed unresolved. XsltTransformProvider carries a note about the same trap costing an initial-template lookup — worth reading before adding a third QName comparison anywhere.

#Fields

Name Description
PhoenixmlVendorNs This engine's own vendor-option namespace. Package declarations here need no other implementation's file format: 'vendor-options': map { QName('http://phoenixml.dev/ns/vendor-options', 'packages'): map { 'http://example.org/lib.xsl' : 'lib/library.xsl', 'http://example.org/other' : map { 'location': 'o.xsl', 'version': '2.0' } } } A map is the authoring form because vendor-options values are XDM items and a map can be written inline in XPath; requiring a configuration DOCUMENT would force every author through somebody else's schema to declare their own packages.
SaxonConfigurationNs The one package-declaration vocabulary recognised today. Add others beside it — the method's contract is "find package declarations", not "read this namespace".
SaxonExtensionNs The namespace of the vendor-options map KEY, which is NOT the namespace of the configuration document element.