Java Extension Function Using the Java Format Namespace

<xsl:stylesheet 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xslt"
xmlns:java="http://xml.apache.org/xslt/java">
   
<xalan:component prefix="Math" functions="sin cos tan atan">
 <xalan:script lang="javaclass" src="http://xml.apache.org/xslt/java"/>
</xalan:component>
   
<xsl:variable name="PI" select="4.0 * java:java.lang.Math:atan(1.0)"/>
   
<!-- ... -->
   
</xsl:stylesheet>

Use this form if you want to access a wide variety of Java-based extensions with a single namespace declaration. The disadvantage is that each invocation becomes more verbose.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.223.160