|
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: |
Electronics & Electrical Equipment
Many electronics and electrical equipment companies need the most powerful XML IDE to power up their companies. Come see which electronics & electrical equipment companies are wired up with Stylus Studio 2006.
Flat File to XML Mapper
Convert any flat file to XML in 3 clicks or less using the Stylus Studio Flat File to XML Mapper. Supports tons of different file encodings: UTF-8, UTF-16, US-ASCII, ISO-8859-1, and more.
XML Project
Stylus Studio's Project Window is an intuitive, visual feature for organizing files belonging to a project. It supports different file-type icons and nested folders; many helpful options are available from the context menu.