1XML::XPathEngine::NodeSUeste(r3)Contributed Perl DocumenXtMaLt:i:oXnPathEngine::NodeSet(3)
2
3
4
6 XML::XPathEngine::NodeSet - a list of XML document nodes
7
9 An XML::XPathEngine::NodeSet object contains an ordered list of nodes.
10 The nodes each take the same format as described in XML::XPa‐
11 thEngine::XMLParser.
12
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
25 new()
26
27 You will almost never have to create a new NodeSet object, as it is all
28 done for you by XPath.
29
30 get_nodelist()
31
32 Returns a list of nodes. See XML::XPathEngine::XMLParser for the format
33 of the nodes.
34
35 string_value()
36
37 Returns the string-value of the first node in the list. See the XPath
38 specification for what "string-value" means.
39
40 to_literal()
41
42 Returns the concatenation of all the string-values of all the nodes in
43 the list.
44
45 get_node($pos)
46
47 Returns the node at $pos. The node position in XPath is based at 1, not
48 0.
49
50 size()
51
52 Returns the number of nodes in the NodeSet.
53
54 pop()
55
56 Equivalent to perl's pop function.
57
58 push(@nodes)
59
60 Equivalent to perl's push function.
61
62 append($nodeset)
63
64 Given a nodeset, appends the list of nodes in $nodeset to the end of
65 the current list.
66
67 shift()
68
69 Equivalent to perl's shift function.
70
71 unshift(@nodes)
72
73 Equivalent to perl's unshift function.
74
75 prepend($nodeset)
76
77 Given a nodeset, prepends the list of nodes in $nodeset to the front of
78 the current list.
79
80
81
82perl v5.8.8 2008-04-14 XML::XPathEngine::NodeSet(3)