PYX::XMLNorm - Processing PYX data or file and do XML normalization.
use PYX::XMLNorm; my $obj = PYX::XMLNorm->new(%parameters); $obj->parse($pyx, $out); $obj->parse_file($input_file, $out); $obj->parse_handler($input_file_handler, $out);
new(%parameters)
my $obj = PYX::XMLNorm->new(%parameters);
Constructor.
flush_stack
Flush stack on finalization.
Default value is 0.
output_handler
Output handler.
Default value is \*STDOUT.
rules
XML normalization rules. Parameter is required. Format of rules is: Outer element => list of inner elements. e.g.
{ 'middle' => ['end'], },
Outer element can be '*'.
Default value is {}.
Returns instance of object.
parse($pyx[, $out])
$obj->parse($pyx, $out);
Parse PYX text or array of PYX text. If $out not present, use 'output_handler'.
$out
Returns undef.
parse_file($input_file[, $out])
$obj->parse_file($input_file, $out);
Parse file with PYX data. If $out not present, use 'output_handler'.
parse_handler($input_file_handler[, $out])
$obj->parse_handler($input_file_handler, $out);
Parse PYX handler. If $out not present, use 'output_handler'.
new(): Cannot exist XML normalization rules. From Class::Utils::set_params(): Unknown parameter '%s'.
use strict; use warnings; use PYX::XMLNorm; # Example data. my $pyx = <<'END'; (begin (middle (end -data )middle )begin END # Object. my $obj = PYX::XMLNorm->new( 'rules' => { 'middle' => ['end'], }, ); # Nomrmalize.. $obj->parse($pyx); # Output: # (begin # (middle # (end # -data # )end # )middle # )begin
Class::Utils, Error::Pure, PYX, PYX::Parser.
A perl module for PYX handling.
Install the PYX modules.
https://github.com/michal-josef-spacek/PYX-XMLNorm
Michal Josef Špaček skim@cpan.org.
© 2011-2023 Michal Josef Špaček
BSD 2-Clause License
0.05
To install PYX::XMLNorm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PYX::XMLNorm
CPAN shell
perl -MCPAN -e shell install PYX::XMLNorm
For more information on module installation, please visit the detailed CPAN module installation guide.