|
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: |
XQuery Functions - User Defined Functions in XQuery
Dr. Michael Kay's tutorial entitled: 'Defining your own Functions in XQuery' explains how to write powerful User Defined Functions in XQuery.
Using DTD in Java Applications
Learn how to validate XML documents using industry-standard DTD's from within your Java applications using Java DTD components including Apache Xerces and XSV.
XML-to-XML Mapper
XML to XML mapping tools in Stylus Studio provide a powerful visual interface for mapping XML data from-and-to virtually any data format using industry-standard XSLT and XQuery technologies.
Microsoft XML Tools
Build Microsoft XML applications with Stylus Studio, which includes development support for all Microsoft XML technologies, including MSXML and Microsoft System.XML (Microsoft XML Parsers), SQL Server 2000, SQL Server 2005 (Yukon), and more.