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 Schema Documentation Generator

Stylus Studio's XML Schema Editor includes an integrated XML Schema documentation generator, allowing you to easily publish XML content models defined in XML Schema in a convenient, HTML format. A screenshon of the XML Schema Editor is shown here.

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.

Converting Custom EDI Message Types to XML

Vital and valuable legacy data locked in proprietary EDI files? See how to use DataDirect XML Converters™ custom EDI message type tools to convert nonconformant EDI to XML.

EDIFACT Sample Converted to XML

A sample EDIFACT document before and after conversion to XML, showing markup and full automatically-generated internal documentation.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member