Declaring an XSLT Extension Function

Extension functions must have one of the following signatures:

public Object FxnName()
       
public Object FxnName(Type1 var1, Type2 var2,...)
       
public static Object FxnName()
       
public static Object FxnName(Type1 var1, Type2 var2,...)
       

    

A class that contains an extension function might look like the following:

import org.w3c.dom.*;
               
public class NumberUtils
               
{ 
               

              
public Object Average(NodeList nl)
                   
{
                   
double nSum = 0;
                   

                
for (int i = nl.getLength() - 1; i >= 0; i--)
{
                   
	nSum += 
                   
	Double.valueOf(nl.item(i).
                   
	getNodeValue()).doubleValue();
                   
}
                   
return new Double(nSum / nl.getLength());
                   
}
                   

                
}

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.

XML-DEV Discussion Forum

XML-DEV is a leading technical forum for XML discussion and a valuable free XML learning resource. Subscribe to the XML-DEV email discussion forum today to help further your XML education.

Report Generation - Visually Defining Relationships in XML Publisher

Develop report generation applications with a powerful relationship manager in XML Publisher which provides a powerful and easy way to group and join data from one or more data sources.

Translating X12 Documents to XML

The X12 to XML Converter is a built-in function of the adapter library. The XML that is generated is well commented and indented, and can be used anywhere XML is normally used — with XML Schemas, XSLT, XQuery, etc.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member