Skip to content

Integration

Nico Kutscherauer edited this page Oct 18, 2024 · 4 revisions

This project uses the XSLT Package Handler.

Note: There is a more detailed but general description how to include modules using the XSLT Package Handler here. The following description is just a summary of the important points inclusive the project specific informations and adjustments.

Maven Settings

Add to your Maven pom.xml:

<dependencies>
    [...]
    <dependency>
        <groupId>com.nkutsche</groupId>
        <artifactId>xmlml</artifactId>
        <version>{xmlml.project.version}</version>
    </dependency>
    <dependency>
        <groupId>com.nkutsche</groupId>
        <artifactId>xslt-pkg-managerXXX</artifactId>
        <version>2.0.0</version>
    </dependency>
</dependencies>

IMPORTANT: Replace XXX with 100, 110 or 120 depending on if you use Saxon 10.x, 11.x or 12.x in your project.

Usage without Maven

You can download the zip package xmlml-...-lib.zip from the release page of this project. The zip package includes

  • all required jar files
  • a Saxon 12
  • a matching XSLT Package Handler

Add all the contained jars to your Java classpath.

There is a another ZIP package xmlml-...-sample.zip that includes an executable sample inclusive an XSLT script which demonstrates some use cases of using the X(ml)² library.

Saxon Setup

  1. Check that all dependency jars are in your classpath. This includes the project jar (xmlml-X.Y.Z.jar) and those from the Package Manager (e.g. xslt-pkg-manager100-2.0.0.jar, ...). Usually Maven should manage this for you.
  2. Add to your Saxon call the argument -init:com.nkutsche.xslt.pkg.handler.PackageManager.

Sample:

java -cp $classpath net.sf.saxon.Transform -init:com.nkutsche.xslt.pkg.handler.PackageManager ...

Package usage in XSLT.

Add to your Main stylesheet the following on top level:

<xsl:use-package name="http://www.nkutsche.com/xmlml" package-version="*"/>

On the Function API page you will find the available functions provided by this package.

Usage of XPath Module

In case you want to use the XPath evaluation module, you have to add an addition xsl:use-package:

<xsl:use-package name="http://www.nkutsche.com/xmlml/xpath" package-version="*"/>

Clone this wiki locally