Robin Smidsrød > XML-Rabbit-0.4.0 > XML::Rabbit::Trait::XPathValueMap

Download:
XML-Rabbit-0.4.0.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.4.0   Source  

NAME ^

XML::Rabbit::Trait::XPathValueMap - Multiple value xpath extractor trait

VERSION ^

version 0.4.0

SYNOPSIS ^

    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;

DESCRIPTION ^

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.

ATTRIBUTES ^

xpath_key

The xpath query that specifies what will be put in the key in the hash. Required.

xpath_value

The xpath query that specifies what will be put in the value in the hash. Required.

METHODS ^

_build_default

Returns a coderef that is run to build the default value of the parent attribute. Read Only.

AUTHOR ^

Robin Smidsrød <robin@smidsrod.no>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 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.

syntax highlighting: