Name : perl-Data-Stag
| |
Version : 0.14
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.1.1
| Date : 2023-01-27 17:34:36
|
Group : Development/Libraries/Perl
| Source RPM : perl-Data-Stag-0.14-lp154.1.1.src.rpm
|
Size : 0.36 MB
| |
Packager : https://www_suse_com/
| |
Summary : Structured Tags datastructures
|
Description :
This module is for manipulating data as hierarchical tag/value pairs (Structured TAGs or Simple Tree AGgreggates). These datastructures can be represented as nested arrays, which have the advantage of being native to perl. A simple example is shown below:
[ person=> [ [ family_name => $family_name ], [ given_name => $given_name ], [ phone_no => $phone_no ] ] ],
Data::Stag uses a subset of XML for import and export. This means the module can also be used as a general XML parser/writer (with certain caveats).
The above set of structured tags can be represented in XML as
< person> < family_name>...< /family_name> < given_name>...< /given_name> < phone_no>...< /phone_no> < /person>
This datastructure can be examined, manipulated and exported using Stag functions or methods:
$document = Data::Stag->parse($file); AATTpersons = $document->find(\'person\'); foreach my $person (AATTperson) { $person->set(\'full_name\', $person->sget(\'given_name\') . \' \' . $person->sget(\'family_name\')); }
Advanced querying is performed by passing functions, for example:
AATTpersons = $document->where(\'person\', sub {shift->sget(\'family_name\') =~ /^A/});
One of the things that marks this module out against other XML modules is this emphasis on a *functional* approach as an obect-oriented or procedural approach.
For full information on the stag project, see http://stag.sourceforge.net
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-D/15.4/x86_64 |