XML::GXML - Perl extension for XML transformation, XML->HTML conversion
use XML::GXML; my $gxml = new XML::GXML(); # Take a scalar, return a scalar my $xml = '<basetag>hi there</basetag>'; my $new = $gxml->Process($xml); # Take a file, return a scalar print $gxml->ProcessFile('source.xml'); # Take a file, output to another file $gxml->ProcessFile('source.xml', 'dest.xml');
GXML is a perl module for transforming XML. It may be put to a variety of tasks; in scope it is similar to XSL, but less ambitious and much easier to use. In addition to XML transformations, GXML is well-suited to translating XML into HTML. Please see the documentation with your distribution of GXML, or visit its web site at:
http://multipart-mixed.com/xml/
These are the options for creating a new GXML object. All options are passed in via a hash reference, as such:
# Turn on HTML mode and provide callbacks hash my $gxml = new XML::GXML({'html' => 'on', 'callbacks' => \%callbacks});
Here's the complete list of options. Keys are provided first, with their values following:
html: 'on' or 1 will format output as HTML (see docs). templateDir: directory to look for templates. remappings: hashref mapping tag names to remap to their remapped names. dashConvert: 'on' or 1 will convert '--' to unicode dash. addlAttrs: reference to subroutine that gets called on lookup for dynamic attributes. addlTemplates: hashref mapping from dynamic template name to subroutine that will create that template. (Use this instead of the following 2 params.) addlTempExists: (outdated -- use addlTemplates instead.) addlTemplate: (outdated -- use addlTemplates instead.)
Josh Carter, josh@multipart-mixed.com
perl(1).
To install XML::GXML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::GXML
CPAN shell
perl -MCPAN -e shell install XML::GXML
For more information on module installation, please visit the detailed CPAN module installation guide.