Altova StyleVision 2024 Basic Edition

If access is via a JAR file, the URI of the JAR file must be specified using the following syntax:




The method is then called by using the prefix of the namespace URI that identifies the class: classNS:method()


 In the above:


java: indicates that a Java function is being called

classname is the name of the user-defined class

? is the separator between the classname and the path

path=jar: indicates that a path to a JAR file is being given

uri-of-jarfile is the URI of the jar file

!/ is the end delimiter of the path

classNS:method() is the call to the method



Alternatively, the classname can be given with the method call. Here are two examples of the syntax:








Here is a complete XSLT example that uses a JAR file to call a Java extension function:


 <xsl:stylesheet version="2.0" 




         xmlns:car="java?path=jar:file:///C:/test/Car1.jar!/" >

 <xsl:output exclude-result-prefixes="fn car xsl xs"/>


 <xsl:template match="/">

                 <xsl:variable name="myCar" select="'red')" /> 

                 <a><xsl:value-of select="car:Car1.getCarColor($myCar)"/></a>



 <xsl:template match="car"/>




Note:When a path is supplied via the extension function, the path is added to the ClassLoader.


© 2018-2024 Altova GmbH