Recipe14.2.Saxon Extension Elements


Recipe 14.2. Saxon Extension Elements

XSLT 1.0 (Saxon Version 6.5.4)

Extension elements in Saxon can be implemented only in Java. You must define a namespace that binds the extension to its implementation. However, the rules are more explicit here than with extension functions. The namespace URI must end with a /, part of which is the fully qualified class name of a Java class that implements 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's extension-element-prefixes attribute.

Details of the ExtensionElementFactory are covered in Recipe 14.15.

XSLT 2.0 (Saxon Version 8.x)

The mechanism is basically the same but the fully qualified class names of the Saxon library have changed (for example, net.sf.saxon.style.ExtensionElementFactory).




XSLT Cookbook
XSLT Cookbook: Solutions and Examples for XML and XSLT Developers, 2nd Edition
ISBN: 0596009747
EAN: 2147483647
Year: 2003
Pages: 208
Authors: Sal Mangano

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net