|
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:
|
Oil, Gas & Electric Companies That Use Stylus Studio
Oil, gas & electric companies know a good resource when they see it. That's why they use Stylus Studio as their #1 XML resource. Come see which of these top oil, gas & electric companies are conserving their time and labor with Stylus Studio.
XML Unicode Encoding
Stylus Studio supports over 300 different file encodings, including UTF-8, UTF-16, EUC-JP, SHIFT-JIS, and more, alowing you to work with any XML document. Robust text editors support standard editing features, and Sense:X intelligent auto-completion.
FLWOR - An Introduction to the XQuery FLWOR Expression
An XQuery FLWOR Tutorial, covering an introduction to the main constructs of the XQuery FLWOR expression, including: For, Let, Where, Order By, and Return. Written by the W3C's Dr. Michael Kay.
Learn XQuery Visually
Stylus Studio offers three infomative XQuery demonstration videos illustrating Stylus Studio's XQuery Editor, Mapper, Debugger and other advanced functionality. Watch them today!