Using the packaging system

MorganaXProc supports the Packing System proposed and developed by EXPath.org and also XMLCatalog.

A detailed description for both systems is pending. Here is a

Short instruction how to use the packaging system in MorganaXProc:

  • Put a repository according to section 7 of the specification in a folder somewhere on your filesystem.
  • Tell MorganaXProc to use the repository by supplying the uri of the repository to property "PKGRepository" in MorganaXProc's configuration.
  • Adapt your settings in the security system to allow access to the packages of the repository.
  • Done!

You can now use the uris exported by the packages in the repository in your XProc pipelines. MorganaXProc will search the repository (and its packages) in p:import and p:document. You can specify the space by using extension attribute {http://expath.org/ns/pkg}kind. If this attribute is missing, MorganaXProc will guess the space of the resource to be loaded by looking on the port name and the step type, in which p:document occurred. For example when p:document appears inside "p:input port="query" of "p:xquery", MorganaXProc will look for a component "xquery" with the specified uri in the found packages.

Reference to components in the packaging system is also supported for module import in p:xquery when MorganaXQueryConnector or SaxonXQueryConnector is used. For p:xslt, components of the packaging system can be referenced in xsl:import and xsl:include when SaxonXSLTConnector is used.

For your convenience there will be an automatic wrapping if the packaging system is not able to load a valid document from the given uri for certain steps/ports:

  • c:query is used with port "query" in p:xquery
  • c:data is used with port "schema" in p:validate-with-relax-ng

In p:nvdl schemas used to validate can to loaded from the package system as well. Just use uris to the packaging system in your <rules>-document. For the EXPath-packaging system the schemas are located in the following order: XMLSchema, RelaxNG, Schematron, DTD. This relevant, because you can have resource with identical uris distinguished by their root element.

Please note:

Before accessing the resource in any package, MorganaXProc's security system will check the uri. So in order to use any component from a package you have to allow this access in the security system's settings.

How to use XMLCatalog

XMLCatalog is used to resolve XML resources in many places where XProc, XSLT, XQuery or XPath needs to access these resources using an uri.

You can select which catalogs to use with "XMLCatalogFiles" in XProcConfiguration.

MorganaXProc relies on Apache™ XML Commons Resolver, therefore you have to have resolver.jar in MorganaXProc_lib. If you do not use XML Catalog you can delete this file from the folder.

Interoperation of the two systems:

MorganaXProc will first to to resolve the uri via the EXPath packaging systems. If this fails, XMLCatalog is used. If this also fails MorganaXProc will try to resolve the uri in a conventional way, i.e. accessing the resource named by this uri from the filesystem or the web.