XML::Grove::Subst

XML::Grove::Subst can substitute values into a template.
Download

XML::Grove::Subst Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ken MacLeod
  • Publisher web site:
  • http://search.cpan.org/~kmacleod/XML-Grove-0.46alpha/lib/XML/Grove/Subst.pm

XML::Grove::Subst Tags


XML::Grove::Subst Description

XML::Grove::Subst can substitute values into a template. XML::Grove::Subst can substitute values into a template.SYNOPSIS use XML::Grove::Subst; # Using subst method on XML::Grove::Document or XML::Grove::Element: $new_grove = $source_grove->subst( ARGS ); $new_grove = $source_grove->subst_hash( ARG ); # Using an XML::Grove::Subst instance: $subster = XML::Grove::Subst->new(); $new_grove = $subster->subst( $source_grove, ARGS ); $new_grove = $subster->subst_hash( $source_grove, ARG );XML::Grove::Subst implements XML templates. XML::Grove::Subst traverses through a source grove replacing all elements with names `SUB:XXX' or `SUB:key' with their corresponding values from ARGS (a list) or ARG (a hash), repsectively.METHODS$grove_obj->subst( ARGS ) =item $subster->subst( $grove_obj, ARGS )Search for `SUB:XXX' elements, where XXX is an array index, and replace the element with the value from ARGS, a list of values. The return value is a new grove with the substitutions applied.$grove_obj->subst_hash( ARG ) =item $subster->subst_hash( $grove_obj, ARG )Search for `SUB:key' elements and replace the element with the value from ARG, a hash of values. The hash key is taken from the `key' attribute of the `SUB:key' element, for example, `< SUB:key key='foo' >'. The return value is a new grove with the substitutions applied.Requirements:· Perl


XML::Grove::Subst Related Software