XML technologies / XSLT / XSLT Kochbuch / Extending and embedding XSLT / Java extension function with a namespace in class format
(Excerpt from "XSLT Kochbuch" by Sal Mangano)
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xslt" xmlns:Math="xalan://java.lang.Math">
<xalan:component prefix="Math" functions="sin cos tan atan">
<xalan:script lang="javaclass" src="xalan://java.lang.Math"/>
</xalan:component>
<xsl:variable name="pi" select="4.0 *"/>
<!-- ... -->
</xsl:stylesheet>If you use this form and omit the element xalan:component, your stylesheet works with both Saxon and Xalan.
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
back to top