Declaring an Extension Function Namespace

In conformance with the XSLT specification, extension functions are accessed through a unique namespace. The namespace declaration can be in any of the following locations:

  • xsl:stylesheet tag
  • Element that contains the XPath expression that invokes the extension function
  • Ancestor of the element that contains the XPath expression that invokes the extension function

The XPath processor treats the namespace URI as a fully qualified class name. If the class name is preceded by class:, all calls are to static methods only. Otherwise, an instance of the class is created on first use and released when stylesheet processing is complete. Performance is better when you use a static method because creation and deletion of an instance of the class is not required.

You can separate package names with either a dot ( .) or a forward slash ( /). An sample namespace declaration might look like the following:

<xsl:stylesheet xmlns:Ext="NumberUtils">
       

    

The XPath processor resolves namespace prefixes in names of extension functions relative to the namespace declarations in the stylesheet.

Visual Data Integration Using Stylus Studio XML Pipeline

XML Pipeline is a visual data integration tool for designing, editing, debugging and deploying XML applications. This tutorial covers building a data integration application that aggregates CSV and EDI data and publishes a report to HTML and PDF.

XHTML Tools

Powerful XHTML Tools for converting HTML to XHTML, validating XHTML, transforming XML to XHTML, editing JSP, creating XML driven Websites and more.

XML Reports

Build beautiful XML reports from Relational, XML and Legacy Data. You XML report can be rendered in PDF or HTML using XSLT, XQuery or XSL:FO.

XSLT Profiler

Stylus Studio's XSL and XSLT profiler allows you to create detailed XSLT performance metrics profiles of any stylesheet in a processor-independent way.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member