XSLT - vendor-specific XSLT extensions.

 These are additional features provided by particular XSLT processors (like Saxon, Xalan, etc.) that go beyond the standard XSLT 1.0/2.0 specifications.


 What Are Vendor-Specific Extensions?

  • XSLT processors often provide extra functions or elements to simplify complex tasks.

  • They are not standard, so code using them may not be portable across processors.

  • Typically used for:

    • Advanced string, math, or date manipulation

    • File I/O

    • Regular expressions (in XSLT 1.0)

    • Serialization options


 Common Vendors & Their Extensions

1. Saxon

  • Saxon is a widely used XSLT processor (supports XSLT 2.0/3.0).

  • Saxon extensions are usually in the http://saxon.sf.net/ namespace.

Examples

  • Regular expressions in XSLT 1.0 (before XSLT 2.0):

    saxon:matches(string, pattern)
    
  • Calling Java methods (when Saxon runs on the JVM):

    <xsl:value-of select="java:Math:max(5,10)"/>
    

2. Xalan

  • Apache Xalan is another popular processor (mostly XSLT 1.0).

  • Extensions are usually in http://xml.apache.org/xalan.

Examples

  • String and number functions:

    xalan:nodeset($variable)
    

    (Converts result tree fragments to node sets.)

  • Java integration:

    <xsl:value-of select="java:Math:max(5,10)"/>
    

3. MSXML (Microsoft)

  • Microsoft’s XSLT processor for Windows.

  • Extensions use msxsl: namespace.

Examples

  • Exposing script functions:

    <msxsl:script language="JScript" implements-prefix="user">
      function greet(name) { return "Hello " + name; }
    </msxsl:script>
    

    Called in XSLT:

    <xsl:value-of select="user:greet('Alice')"/>
    
  • Debugging:

    msxsl:message('Debug info')
    

4. libxslt

  • Open-source processor used in Linux/Unix (xsltproc).

  • Supports some EXSLT modules as its extensions.

  • Namespace: http://exslt.org/common for functions like node-set().


 Key Points About Vendor-Specific Extensions

  1. Portability warning — code may break on another processor.

  2. Often provide functionality missing in XSLT 1.0.

  3. Frequently used for:

    • Node-set conversion (exsl:node-set)

    • Calling host-language functions (Java, JScript, etc.)

    • String/date/time/mathematical utilities

  4. In XSLT 2.0 and 3.0, many vendor extensions are replaced by built-in functions.