Catmandu::XML::Transformer(3pm)

Catmandu::XML::Transformer3pm

Utility module for xml/xslt processing

Synopisis

    $transformer = Catamandu::XML::Transformer->new( stylesheet => 'file.xsl' );
    $xml_string = $transformer->transform( $xml_string ); # SCALAR
    $xml_dom    = $transformer->transform( $xml_dom );    # XML::LibXML::Document
    $xml_struct = $transformer->transform( $xml_struct ); # ARRAY reference
    $xml_simple = $transformer->transform( $xml_simple ); # HASH reference
    $transformer = Catamandu::XML::Transformer->new( output_format => 'string' );
    $xml_string  = $transformer->transform( $xml );       # any XML to SCALAR

Configuration

stylesheet

Zero or more XSLT files given as comma-separated list of files or array reference with multiple files to apply as transformation pipeline. Files are parsed once on instantiation of the Catmandu::XML::Transformer object.

output_format

Expected output format "dom", "string", "struct", "simple". By default the input format triggers the output format. If the last stylesheet has text output ("<xsl:output method="text"/>") then output format is automatically set to "string".

Methods

stylesheet()

Returns an array reference of XSLT filenames used as transformation pipeline.

output_format()

Returns the output format or "undef".

Releases

4 releases since Debian 10 (Buster); the text changed 2 times.

  1. 10
  2. 11
  3. 12–13

From libcatmandu-xml-perl 0.17-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.