NAME

XML::RSS::Parser::Element -- a simple object that holds one node in the XML::RSS::Parser parse tree.

DESCRIPTION

XML::RSS::Parser::Element is a simple object that holds one node in the parse tree. Roughly based on XML::SimpleObject.

METHODS

XML::RSS::Parser::Element->new( [\%init] )

Constructor for XML::RSS::Parser::Element. Optionally the name, value, attributes, root, and parent can be set with a HASH reference using keys of the same name. See their associated functions below for more.

$element->root( [$feed] )

Returns a reference to the root element (typically a XML::RSS::Parser::Feed. If an optional SCALAR parameter is passed in the root element is set. Is undefined if not set.

$element->parent( [$element] )

Returns a reference to the parent element. If an optional SCALAR parameter is passed in the parent element is set. Is undefined if not set.

$element->name( [$extended_name] )

Returns the name of the element as a SCALAR. This should by the fully namespace qualified (extended) name of the element and not the QName or local part. Is undefined if not set.

$element->value( [$value] )

Returns a reference to the parent element. If an optional SCALAR parameter is passed in the parent element is set. Returns a null string if not set.

$element->append_value( $value )

Appends the value of the SCALAR parameter to the object's current value. A convenience method that is particularly helpful when working in XML::Parser handlers.

$element->attribute($name [, $value] )

Returns the value of an attribute specified by $name as a SCALAR. If an optional second parameter ($value) is passed in the attribute is set.

$element->attributes( [\%attributes] )

Returns a HASH reference contain attributes and their values as key value pairs. An optional parameter of a HASH reference can be passed in to set multiple attributes. NOTE: When setting attributes with this method, all existing attributes are overwritten irregardless of whether they are present in the hash being passed in.

$element->child( [$extended_name] )

Constructs and returns a new element object making the current element its parent. An optional parameter representing the name of the new element object can be passed. This should be the fully namespace qualified (extended) name and not the QName or local part.

$element->children( [$extended_name] )

Returns any array of child elements to the object. An optional parameter can be passed in to return element(s) with a specific name. If called in a SCALAR context it will return only the first element with this name. If called in an ARRAY context the function returns all elements with this name. If no elements exist as a child of the object, and undefined value is returned.

$element->children_names

Returns an array contain the names of the objects children.

$element->match($xpath)

Finds matching nodes using an XPath-esque query from anywhere in the tree. See the Class::XPath documentation for more information.

$element->xpath

Returns an unique XPath string to the current node which can be used as an identifier.

SEE ALSO

XML::RSS::Parser, XML::SimpleObject, Class::XPath

LICENSE

The software is released under the Artistic License. The terms of the Artistic License are described at http://www.perl.com/language/misc/Artistic.html.

AUTHOR & COPYRIGHT

Except where otherwise noted, XML::RSS::Parser is Copyright 2003-4, Timothy Appnel, cpan@timaoutloud.org. All rights reserved.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 138:

'=item' outside of any '=over'

Around line 206:

You forgot a '=back' before '=head1'