|
Home > Online Product Documentation > Table of Contents > Using an Extension Function in Stylus Studio Using an Extension Function in Stylus StudioThe process of using an extension function in Stylus Studio involves three main steps:
1. First, you need to write a Java class that can be used from within a stylesheet. In this example, the
SystemDate() method returns the system date and time as a string:
2. Second, compile your class and register it on the Stylus Studio host by copying the
.class file to a location defined in the host's
CLASSPATH environment variable.
3. Finally, specify information in the stylesheet so that Stylus Studo can use your class. You do this with a namespace reference in the
xsl:stylesheet tag. For example, define a namespace as
xmlns:Ext where
Ext is the prefix to use when calling the class methods. (
Ext is not a predefined keyword; it can be replaced by any other legal string.) The namespace reference then takes the class name as a value. In this example, the whole reference looks like the following:
The class is now available from within the stylesheet and can be used in a template such as the following:
The XSLT stylesheet might look like the following:
|
XML to PDF
Convert XML to PDF using Stylus Studio's XML publishing tools - the easiest way to design beautiful document layouts for use in XSL:FO based multi-channel publishing and single source publishing applications.
Hotels, Casinos & Resorts That Use Stylus Studio
What's more romantic than a vacation for two and the world's best XML IDE at your finger tips? Nothing, that's why these hotels, casinos, & resorts are using Stylus Studio to help you get on your dream vacation.
Binary XML
How do I get my binary data into XML? How do I get my binary data out of XML? The answers to these questions and more in this amazing Binary XML tutorial.
XML Code Folding
Stylus Studio's XML Editor features XML code folding, a powerful and intuitive way to maximize limited screen real-estate and help make sense of large XML files.


