NAME

oEdtk::XML::Default - the default Cameleon XML reader

SYNOPSIS

use oEdtk::XML::Default qw(cameleon_open cameleon_extract);

my $xpc  = cameleon_open($fh);
my $data = cameleon_extract($xpc, '/some/cpe/path');

DESCRIPTION

Read the key/value pairs a Cameleon generative process writes into its XML output. Moved from oEUser::XML::Default into the mainline at S21 of the fork-merge plan (decision D23); the old name stays available as a delegate.

FUNCTIONS

cameleon_open

my $xpc = cameleon_open($fh, $path);

Load the Cameleon XML from the open filehandle $fh and return an XML::LibXML::XPathContext over it.

cameleon_extract

my $data = cameleon_extract($xpc, $path);

Return the bpTypeDonnee / bpValeur pairs of the ItemSalesBreakdownLine whose cpe attribute is $path, or undef when a pair is incomplete. Values are encoded to ISO-8859-15, with the typographic apostrophe and ellipsis folded to their ASCII equivalents.

The internal helper my_encode, which encodes a value to ISO-8859-15 while warning about any character it cannot map, is not part of the public API.

AUTHOR

The oEdtk team.