Extension Objects
The WebWorks ePublisher engine uses XML, XSL, and XPath as the foundation for all processing. While extremely powerful, XSL has many shortcomings when used to perform system level scripting tasks. Operations such as working with files and advanced string operations are not included in the standard XSL language.
XSL does provide a generic extension mechanism to add new features to the base language. WebWorks ePublisher provides a standard set of extension objects which enable XSL to generate all required formats.
General XSL Extensions
XSL extensions live in a specific namespace. Users can define their own prefix to associate with a given namespace, but in general sticking with a consistent naming convention makes life easier.
For example, the XSL namespace is:
http://www.w3.org/1999/XSL/Transform
To define a prefix for it, one adds an XSL namespace declaration to your XSL stylesheet:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> .. </xsl:stylesheet>
Now the desired namespace can be referenced just using a prefix rather than the actual namespace. Therefore, the following two lines are equivalent:
<xsl:variable name="VarNew" select="'Hello'" /> <variable xmlns="http://www.w3.org/1999/XSL/Transform" name="VarNew" select="'Hello'" />
Microsoft's XSL transform implementation does not support extension elements at this time. Therefore, methods must be called from within "select" contexts.
<xsl:value-of select="wwexsldoc:Document($VarResult, $VarPath)" /> <xsl:variable name="VarDocumentWrite" select="wwexsldoc:Document($VarResult, $VarPath)" />
Microsoft Extensions
Extension objects that are defined and implemented by Microsoft as part of the .NET XSL transform runtime.
ePublisher Extensions
ePublisher implements a variety of extension objects to enable full processing of desired output within the language of XSL.
NOTE: Optional parameters are shown in italic.
Custom Extensions
The Microsoft XSL transform engine also supports custom extensions defined with script blocks.