Novell is now a part of Micro Focus

Calling External Java Classes from DirXML Stylesheets

Articles and Tips: tip

Mark Lowings
Novell, Inc.

01 Aug 2001

With DirXML, you can call standard Java classes or self-created classes from Jar files from any stylesheet that is located in the SYS:SYSTEM\LIB directory on a NetWare server, or from the \NOVELL\NDS\LIB directory on a Windows NT/2000 server.

Within the stylesheet, you need to declare a new name space, which is used to address the class. You then create a class instance by calling the constructor method. To use this method, you must pass the new class instance as well as any required parameters.

Below is an example of such a process:

<!--declare name space in template-->

<xsl:template name="getCN" xmlns:gta String=" com.novell.gta.String2dn">

<!--create new class instance-->

<xsl:variable name="instance" select="gtaString:new()"/>

<!--call method with instance name-->

<xsl:variable name="cn" select="gtaString:getcn($instance,$dn)"/>

* Originally published in Novell AppNotes


The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates