1XML::XPathEngine::NodeSUeste(r3)Contributed Perl DocumenXtMaLt:i:oXnPathEngine::NodeSet(3)
2
3
4

NAME

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

DESCRIPTION

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

SYNOPSIS

14               my $results = $xp->find('//someelement');
15               if (!$results->isa('XML::XPathEngine::NodeSet')) {
16                       print "Found $results\n";
17                       exit;
18               }
19               foreach my $context ($results->get_nodelist) {
20                       my $newresults = $xp->find('./other/element', $context);
21                       ...
22               }
23

API

25   new()
26       You will almost never have to create a new NodeSet object, as it is all
27       done for you by XPath.
28
29   get_nodelist()
30       Returns a list of nodes. See XML::XPathEngine::XMLParser for the format
31       of the nodes.
32
33   string_value()
34       Returns the string-value of the first node in the list.  See the XPath
35       specification for what "string-value" means.
36
37   string_values()
38       Returns a list of the string-values of all the nodes in the list.
39
40   to_literal()
41       Returns the concatenation of all the string-values of all the nodes in
42       the list.
43
44   get_node($pos)
45       Returns the node at $pos. The node position in XPath is based at 1, not
46       0.
47
48   size()
49       Returns the number of nodes in the NodeSet.
50
51   pop()
52       Equivalent to perl's pop function.
53
54   push(@nodes)
55       Equivalent to perl's push function.
56
57   append($nodeset)
58       Given a nodeset, appends the list of nodes in $nodeset to the end of
59       the current list.
60
61   shift()
62       Equivalent to perl's shift function.
63
64   unshift(@nodes)
65       Equivalent to perl's unshift function.
66
67   prepend($nodeset)
68       Given a nodeset, prepends the list of nodes in $nodeset to the front of
69       the current list.
70
71
72
73perl v5.16.3                      2010-09-15      XML::XPathEngine::NodeSet(3)
Impressum