XML::Rabbit::Trait::XPathValueMap - Multiple value xpath extractor trait
version 0.4.1
package MyXMLSyntaxNode; use Moose; with 'XML::Rabbit::RootNode'; has reference_map => ( isa => 'HashRef[Str]', traits => [qw(XPathValueMap)], xpath_query => '//*[@href]', xpath_key => './@href', xpath_value => './@title'; ); no Moose; __PACKAGE__->meta->make_immutable(); 1;
This module provides the extraction of primitive values from an XML node based on an XPath query.
See XML::Rabbit for a more complete example.
The xpath query that specifies what will be put in the key in the hash. Required.
The xpath query that specifies what will be put in the value in the hash. Required.
Returns a coderef that is run to build the default value of the parent attribute. Read Only.
Robin Smidsrød <robin@smidsrod.no>
This software is copyright (c) 2015 by Robin Smidsrød.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install XML::Rabbit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Rabbit
CPAN shell
perl -MCPAN -e shell install XML::Rabbit
For more information on module installation, please visit the detailed CPAN module installation guide.