The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

XML::Xalan - Perl interface to Xalan

SYNOPSIS

  use XML::Xalan;

  $p = new XML::Xalan;
  $p->parse_stylesheet($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_stylesheet($xsl_file)

Parses a specified stylesheet, and stores the result internally for further usages.

$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).