Name : perl-XML-Rabbit
| |
Version : 0.4.1
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp155.310.1
| Date : 2023-07-20 17:22:40
|
Group : Development/Libraries/Perl
| Source RPM : perl-XML-Rabbit-0.4.1-lp155.310.1.src.rpm
|
Size : 0.12 MB
| |
Packager : https://www_suse_com/
| |
Summary : Consume XML with Moose and xpath queries
|
Description :
XML::Rabbit is a Moose-based class construction toolkit you can use to make XPath-based XML extractors with very little code. Each attribute in your class created with the above helper function is linked to an XPath query that is executed on your XML document when you request the value. Creating object hierarchies that mimic the layout of the XML document is almost as easy as doing a search and replace on the XML DTD (if you have one).
You can return multiple values from the XML either as arrays or hashes, depending on how you need to work with the data from the XML document.
The example in the synopsis shows how to create a class hierarchy that enables easy retrival of certain information from an XHTML document.
Also notice that if you specify an xpath query that can return multiple XML elements, you need to specify a hash map (xml tag => class name) instead of just specifying the class name returned.
All the array and hash-returning attributes are tagged with the Array and Hash native traits, so it is quick and easy to specify additional delegations. All the \'has_xpath_value*\' helpers expect the value to be of a \'Str\' type constraint. Array and hash-returning attributes automatically set their isa to \'ArrayRef[Str]\' and \'HashRef[Str]\' respectively.
All the helper methods and their associated arguments are explained in XML::Rabbit::Sugar detail.
Be aware that if your XML document contains a default XML namespace (like XHTML does), you MUST specify it with \'add_xpath_namespace()\', or else your xpath queries will not match anything. The XML document is not scanned for XML namespaces during initialization.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-X/15.5/noarch |