Codex

XML::XPathEngine::NodeSet

Section: User Contributed Perl Documentation (3pm)

Updated: 2010-09-15

Index?action=index Return to Main Contents


NAME

XML::XPathEngine::NodeSet - a list of XML document nodes

DESCRIPTION

An XML::XPathEngine::NodeSet object contains an ordered list of nodes. The nodes each take the same format as described in XML::XPathEngine::XMLParser.

SYNOPSIS

API

<H3 CLASS="c1|new()

You will almost never have to create a new NodeSet object, as it is all done for you by XPath.

<H3 CLASS="c1|get_nodelist()

Returns a list of nodes. See XML::XPathEngine::XMLParser for the format of the nodes.

<H3 CLASS="c1|string_value()

Returns the string-value of the first node in the list. See the XPath specification for what ``string-value'' means.

<H3 CLASS="c1|string_values()

Returns a list of the string-values of all the nodes in the list.

<H3 CLASS="c1|to_literal()

Returns the concatenation of all the string-values of all the nodes in the list.

get_node($pos)

Returns the node at . The node position in XPath is based at 1, not 0.

<H3 CLASS="c1|size()

Returns the number of nodes in the NodeSet.

<H3 CLASS="c1|pop()

Equivalent to perl's pop function.

push(@nodes)

Equivalent to perl's push function.

append($nodeset)

Given a nodeset, appends the list of nodes in to the end of the current list.

<H3 CLASS="c1|shift()

Equivalent to perl's shift function.

unshift(@nodes)

Equivalent to perl's unshift function.

prepend($nodeset)

Given a nodeset, prepends the list of nodes in to the front of the current list.

Index

NAME

DESCRIPTION

SYNOPSIS

API

:<A CLASS="c2" HREF="#lbAF|new()]]

:<A CLASS="c2" HREF="#lbAG|get_nodelist()]]

:<A CLASS="c2" HREF="#lbAH|string_value()]]

:<A CLASS="c2" HREF="#lbAI|string_values()]]

:<A CLASS="c2" HREF="#lbAJ|to_literal()]]

get_node($pos)

:<A CLASS="c2" HREF="#lbAL|size()]]

:<A CLASS="c2" HREF="#lbAM|pop()]]

push(@nodes)

append($nodeset)

:<A CLASS="c2" HREF="#lbAP|shift()]]

unshift(@nodes)

prepend($nodeset)