logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

XML::LibXSLT::Quick - an easier to use (= "quicker") interface to XML::LibXSLT

Description

       This is a module that wraps XML::LibXSLT with an easier to use interface.

       It can be used to process XML documents using XSLT (Extensible Stylesheet Language Transformations)
       <https://en.wikipedia.org/wiki/XSLT> stylesheets.

Methods

XML::LibXSLT::Quick->new({location=>"./xslt/my.xslt",});
       TBD.

   $obj->stylesheet()
       The result of parse_stylesheet().

   $obj->xml_parser()
       The XML::LibXML instance.

   $obj->generic_transform($dest,$source)
       To be discussed.

       See "t/using-quick-wrapper.t" .

       $dest can be:

       "\$my_string_var"

       "{type => 'dom', }" - the DOM will be returned.

       "{type => 'file', path => $filepath, }" - the output string will be written to $filepath .

       "{type => 'implicit', }" - the output string will be calculated but implicitly discarded and undef()
       returned. (Added in version 2.00300 .)

       "{type => 'return', }" - the output string will be returned.

       $source can be:

       A string.

       "{type => 'file', path => $filepath, params => +{}, }" - the file will be parsed.

       "{type => 'string', string => $my_xml_string, params => +{}, }" - the string will be parsed.

   $obj->output_as_chars($dom)$obj->transform(...)$obj->transform_into_chars(...)
       Delegating from $obj->stylesheet() . See XML::LibXSLT .

Name

       XML::LibXSLT::Quick - an easier to use (= "quicker") interface to XML::LibXSLT

See Also

       XML::LibXSLT::Easy by Yuval Kogman - requires some MooseX modules.

       XML::LibXSLT - used as the backend of this module.

Synopsis

           use XML::LibXSLT::Quick ();

           my $stylesheet =
               XML::LibXSLT::Quick->new( { location => 'example/1.xsl', } );
           my $xml1_text = _utf8_slurp('example/1.xml');
           my $out_fn = 'foo.xml';
           $stylesheet->generic_transform(
               +{
                   type => 'file',
                   path => $out_fn,
               },
               $xml1_text,
           );

See Also