FXPath for SAXON |
||||||||
|
FXPath for SAXON is a modified version of SAXON 6.2.1. SAXON is the XSLT Processor from Michael Kay. The modifications are distributed as an add-on, i.e., the distribution does not contain the full SAXON implementation. In order to use FXPath for SAXON, you must first obtain the original JAR file for version 6.2.1 of SAXON: http://users.iclway.co.uk/mhkay/saxon/.
To use FXPath in SAXON, you should prepend the
fxpath-saxon621.jar to your class path, as in:
java -classpath fxpath-saxon621.jar:saxon.jar com.icl.saxon.StyleSheet -o test.out test.xml test.xsl
fxpath-saxon621.jar occurs
before the saxon.jar, otherwise the modifications will
not have any effect.Here is a short example of a stylesheet that will tell you if everything was correctly set up:
<xsl:stylesheet version="1.0" xmlns:fx="http://www.pantor.com/fxpath" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <fx:define name="fx:add"> function ($x, $y) -> $x + $y </fx:define> <xsl:template match="/"> <xsl:if test="fx:add (1, 2) = 3"> <xsl:message> It works! </xsl:message> </xsl:if> </xsl:template> </xsl:stylesheet>
Please see the FXPath specification for more information on how to implement extension functions in FXPath.
In the source code distribution, there is a file named
examples.xsl that contains all the examples from
the FXPath specification.
The FXPath implementation in SAXON is very experimental. However, it implements all the features described in the specification.
One puropse with this implementation is to show the complexity (or lack there of) involved in extending a typical XSLT/XPath engine with FXPath functionality.
It may certainly contain bugs. Almost no attempts has been made to optimize or fully test the modifications.
This version does not report all errors specified in the FXPath specification. Notably: variable binding shadowing rules are not checked.
Binary version: http://www.pantor.com/fxpath/fxpath-saxon621.jar
Soure code: http://www.pantor.com/fxpath/fxpath-saxon621-src.zip
The contents of the downloaded files (fxpath-saxon621.jar and fxpath-saxon621-src.zip) are subject to the Mozilla Public License 1.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/. A copy is also included in the source code distribution.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License.
The Initial Developer of the Original Code is Michael Kay of International Computers Limited.
The Contributor of this Modification is David Rosenborg (david.rosenborg@pantor.com).