https://github.com/michal-josef-spacek/pyx-xmlnorm
Processing PYX data or file and do XML normalization.
https://github.com/michal-josef-spacek/pyx-xmlnorm
Last synced: 2 months ago
JSON representation
Processing PYX data or file and do XML normalization.
- Host: GitHub
- URL: https://github.com/michal-josef-spacek/pyx-xmlnorm
- Owner: michal-josef-spacek
- License: bsd-2-clause
- Created: 2015-02-08T19:59:00.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-10-19T09:14:19.000Z (over 1 year ago)
- Last Synced: 2025-01-01T04:45:47.527Z (4 months ago)
- Language: Perl
- Size: 84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
NAME
PYX::XMLNorm - Processing PYX data or file and do XML normalization.SYNOPSIS
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);METHODS
"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'.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'.
Returns undef.
"parse_handler($input_file_handler[, $out])"
$obj->parse_handler($input_file_handler, $out);Parse PYX handler. If $out not present, use 'output_handler'.
Returns undef.
ERRORS
new():
Cannot exist XML normalization rules.
From Class::Utils::set_params():
Unknown parameter '%s'.EXAMPLE
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
# )beginDEPENDENCIES
Class::Utils, Error::Pure, PYX, PYX::Parser.SEE ALSO
PYX A perl module for PYX handling.Task::PYX
Install the PYX modules.REPOSITORY
AUTHOR
Michal Josef Špaček [email protected].LICENSE AND COPYRIGHT
© 2011-2023 Michal Josef ŠpačekBSD 2-Clause License
VERSION
0.06