NAME
XML::Xalan - Perl interface to Xalan
SYNOPSIS
use XML::Xalan;
$p = new XML::Xalan;
$p->parse_file($xsl_file);
$p->transform_to_file($src_file, $dest_file);
or die $p->errstr;
my $res = $p->transform_to_data($src_file);
DESCRIPTION
This module provides easy-to-use object oriented interface on top of several Xalan classes, as well as interfaces to those classes.
METHODS
- new()
-
Constructor, with no argument. Returns an XML::Xalan object.
$p = new XML::Xalan;
- $p->parse_file($xsl_file)
-
Takes a path to the stylesheet file as the argument, parses it and stores the result internally for further usages. Example:
$p->parse_file('./samples/docs/foo.xsl');
- $p->parse_stylesheet($xsl_doc)
-
Same as parse_file(), but takes an XML::Xalan::Document object instead as the argument.
See the documentation of XML::Xerces::ParserLiaison on how to get an XML::Xalan::Document object.
- $p->transform_to_file($src_file, $dest_file)
-
Takes an XML document as input, and writes the output to the specified file. Returns undef on failure. The following takes foo.xml and writes to bar.xml:
$p->transform_to_file("foo.xml", "bar.xml") or die $p->errstr;
- $p->transform_to_data($src_file)
-
Returns the transformed document on success, otherwise returns undef.
$result = $p->transform_to_data("foo.xml"); die $p->errstr unless defined $result;
- $p->transform_doc_to_file($xalan_doc, $dest_file)
-
Takes an XML::Xalan::Document object as the input, and writes the result to $dest_file. Returns TRUE on success, otherwise returns undef.
See the documentation of XML::Xerces::ParserLiaison for details on using this method.
- $p->transform_doc_to_data($xalan_doc)
-
Takes an XML::Xalan::Document object as the input, and returns the transformation result. Returns undef on error.
See the documentation of XML::Xerces::ParserLiaison for details on using this method.
- $p->errstr()
-
Returns current error string.
AUTHOR
Edwin Pratomo, edpratomo@cpan.org
SEE ALSO
XML::Xerces::ParserLiaison(3), XML::Xalan::Transformer(3).