This module is used both as a base for YAX::Elememt, YAX::Text and YAX::Fragment. It is also partly mixed into YAX::Document.
It is also used to represent comment, cdata sections and processing instruction nodes.
Returns the type of the node as a number in a way analogous to the W3C DOM:
use YAX::Constants qw/:all/; if ( $node->type == ELEMENT_NODE ) { ... }
If the node is an element node, then returns the tag name, otherwise returns a human readible string: '#text', '#document', '#processing-instruction', etc.
Used for text nodes, CDATA sections, processing instructions and declaration nodes to store the text values associated with them.
Returns the next sibling if any.
Returns the previous sibling if any.
Returns the parent node if any.
Returns the document node ancestor of this node. Only works if this node is actually part of the tree (this is different to the W3C DOM where a node remains owned by a document after it is removed).
Serializes this node. '""' is overloaded to call this method, so the following are equivalent:
my $xml_str = $node->as_string; my $xml_str = "$node";
YAX:Element, YAX::Text, YAX::Fragment, YAX::Constants, YAX::Document
Richard Hundt
This program is free software and may be modified and distributed under the same terms as Perl itself.
To install YAX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm YAX
CPAN shell
perl -MCPAN -e shell install YAX
For more information on module installation, please visit the detailed CPAN module installation guide.