Altsoft XML2PDF Formatting Engine is based on the Microsoft .NET XML parser and supports all its standard XSLT extensions with C#, Visual Basic .NET and JScript.

To use your own custom XSLT extension function you need to:

  1. declare the prefix for your extension function(s) using URL “urn:the-xml-files:xslt”. For example:
    <xsl:stylesheet ... xmlns:my="urn:the-xml-files:xslt" ...>
  2. declare the namespace ms for Microsoft XSLT extensions:
    <xsl:stylesheet ... xmlns:ms="urn:schemas-microsoft-com:xslt" ...>
  3. add a C# (VB.NET or JScript) code inside <ms:script> element:
    <ms:script language="C#" implements-prefix="my">
    <![CDATA[
       String Date()
       {
          return DateTime.Now.ToString(
            "dd. MMMM, yyyy", 
            new System.Globalization.CultureInfo("nl-BE") );
       }
    ]]>
    </ms:script>
  4. use the declared function anywhere in you code. For example:
    <xsl:value-of select="my:Date()"/>

Please refer to the Extending XSLT with C# sample for more samples and to the “Extending XSLT with JScript, C#, and Visual Basic .NET” article in MSDN Magazine for technical details.