On 14.03.2019 10:56, Christian Grün wrote:
Maybe we could port Gerrit’s code to XQuery… Volunteers are welcome ;)

You probably can’t instruct Saxon to use the XSLT-based resolver (or an XQuery-based resolver) when reading XML files using doc() or xsl:import. I think it needs Java classes that provides certain interfaces. Not sure whether it makes sense to provide a Java class that executes XQuery when you can use a resolver that is written directly in Java.

Background for our XSLT-based resolver: We are using it in order to resolve canonical URIs of fonts or other resources that we need to read from the file system from within XSLT stylesheets or XProc pipelines, but that cannot be read by doc() (since they are not XML) or the EXPath file module methods (since Saxon won’t use the catalog resolver for file:read-binary()). However, we still want to be able to refer to these resources by a canonical URI such as http://transpect.io/fontlib/dejavu-sans/condensed-regular/DejaVuSansCondensed.ttf (which refers to a local copy of https://subversion.le-tex.de/common/fontlib/dejavu-sans/condensed-regular/DejaVuSansCondensed.ttf, using https://subversion.le-tex.de/common/fontlib/xmlcatalog/catalog.xml for the resolution).

A detail: We usually rely on the XML catalog resolver to resolve the URI to the XML catalog that we supply to the XSLT-based resolver. In a typical transpect project, the canonical catalog URI is at http://this.transpect.io/xmlcatalog/catalog.xml which resolves to {local_project_base_uri}/xmlcatalog/catalog.xml. Then we use this catalog to resolve URIs of non-XML resources.

Reply via email to