XML::XSLT - A perl module for processing XSLT
$XSLT::Parser->open_project ($xmlfile, $xslfile); $XSLT::Parser->process_project; $XSLT::Parser->print_result;
The variables $xmlfile and $xslfile are filenames, e.g. "filename",
or regular Perl filehandles, pass those with *FILEHANDLE.
# Alternatives for open_project()
$XSLT::Parser->open_project ($xmlstring, $xslstring, "STRING", "STRING");
The variables $xmlstring and $xslstring are regular Perl scalars
variables or references to these, pass the latter with \$string.
$XSLT::Parser->open_project ($xmldom, $xsldom, "DOM", "DOM");
The variables $xmldom and $xsldom are XML::DOM trees. The Document Node
should be passed here.
# String, file and DOM input can be intermingled
$XSLT::Parser->open_project ($xmlfile_or_handle, $xslstring_or_ref, "FILE", "STRING");
$XSLT::Parser->open_project ($xmlDOMtree, $xslfile_or_handle, "DOM", "FILE");
# Alternatives for print_result()
The variable $outputfile is a filename, e.g. "filename" or a regular
Perl filehandle. Pass the latter with *FILEHANDLE.
This module implements the W3C's XSLT specification. The goal is full implementation of this spec, but it isn't yet. However, it already works well. Below is given the set of working xslt commands.
XML::XSLT makes use of XML::DOM and LWP::UserAgent, while XML::DOM uses XML::Parser. Therefore XML::Parser, XML::DOM and LWP::UserAgent have to be installed properly for XML::XSLT to run.
Copyright (c) 1999 Geert Josten & Egon Willighagen. All Rights Reserverd. This module is free software, and may be distributed under the same terms and conditions as Perl.
Not supported yet.
Attribute 'select' is supported to the same extent as xsl:value-of supports path selections.
Not supported yet: - attribute 'mode' - xsl:sort and xsl:with-param in content
Adds an attribute named to the value of the attribute 'name' and as value the stringified content-template.
Not supported yet: - attribute 'namespace'
Takes attribute 'name' which selects xsl:template by name.
Not supported yet: - xsl:sort and xsl:with-param in content
Tests sequentially all xsl:whens until one succeeds or until an xsl:otherwise is found. Limited test support, see xsl:when
It is implemented, but it does not appear in the result
Not supported yet: - attribute 'use-attribute-sets'
Attribute 'select' functions as well as with xsl:value-of
Not supported yet: - xsl:sort in content
Identical to xsl:when, but outside xsl:choose context.
Takes attribute href, which can be relative-local, absolute-local as well as an URL (preceded by identifier http:).
Not supported yet. Whitespace is always preserved.
Not supported yet. No whitespace is stripped.
Has to be present. None of the attributes supported yet.
Attribute 'name' and 'match' are supported to minor extend. ('name' must match exactly and 'match' must match with full path or no path)
Not supported yet: - attributes 'priority' and 'mode'
Not supported yet: - attribute 'disable-output-escaping'
Inserts attribute or element values. Limited support:
and combinations of these;
Only inside xsl:choose. Limited test support:
Support can be obtained from the XML::XSLT mailling list:
General information, like bugs and current functionality, can be found at the XML::XSLT homepage:
To install XML::XSLTParser, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.