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.

HTML Tidy

HTML Tidy is a program for turning HTML into something that can be parsed as XML, unlocking their data for use in XSLT and XQuery programs. Learn how to use HTML Tidy in Stylus Studio now.

Manufacturing

Manufacturing

OASIS Catalog Support

Stylus Studio's features for working with OASIS catalogs allow you to incorporate any vendor's catalog - or one of your own - in your XML, making writing correct and robust XML easier than ever.

Validating X12 Documents with XML Schemas

Either before or after transforming X12 EDI content, generated XML Schemas will make sure that we have all of the necessary components, our codes are all according to the standard codelists, and every little delimiter is in the right place.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member