XML technologies / XSLT / XSLT Kochbuch / Extending and embedding XSLT / Saxon extension elements
(Excerpt from "XSLT Kochbuch" by Sal Mangano)
XSLT 1.0 (Saxon version 6.5.4)
Extension elements in Saxon can only be implemented in Java. To do this, you must define a namespace that binds the extension to its implementation. The rules are somewhat more precise here than for extension functions. The namespace URI must end with a /, and part of it is the fully qualified class name of a Java class implementing the interface com.icl.saxon.ExtensionElementFactory:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:acmeX="http://www.acmeX.com/com.acemX.SuperExtensionFactory" extension-element-prefixes="acmeX">
<!-- ... -->
</xsl:stylesheet>The prefix must also be listed in the stylesheet attribute extension-element-prefixes.
Details of ExtensionElementFactory are covered in the recipe Adding extension elements with Java.
XSLT 2.0 (Saxon version 8.x)
The mechanism is essentially the same, but the fully qualified class names in the Saxon library have changed (e.g. net.sf.saxon.style.ExtensionElementFactory).
Copyright © 2006 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from "XSLT Kochbuch" is subject to the same terms as the printed edition: the work and all its parts are protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O'Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de