NAME

XML::Rabbit::RootNode - Root node base class

VERSION

version 0.4.1

SYNOPSIS

package MyXMLSyntax;
use Moose;
with 'XML::Rabbit::RootNode';

has title => (
    isa         => 'Str',
    traits      => [qw(XPathValue)],
    xpath_query => '/root/title',
);

no Moose;
__PACKAGE__->meta->make_immutable();

1;

DESCRIPTION

This module provides the base node attribute used to hold the root of the XML document.

See XML::Rabbit for a more complete example.

ATTRIBUTES

node

An instance of a XML::LibXML::Node class representing the root node of an XML document. Read Only.

It is lazily loaded from the document attribute, which is inherited from XML::Rabbit::Role::Document.

xpc

An instance of a XML::LibXML::XPathContext class initialized with the node attribute. Read Only.

If a subclass has an attribute named namespace_map which is a HashRef it is used to initialize namespaces using the registerNs method. This is required on XML files that use namespaces, like XHTML.

AUTHOR

Robin Smidsrød <robin@smidsrod.no>

COPYRIGHT AND LICENSE

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.