Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xml::xpath::nodeset(3pm) [debian man page]

XPath::NodeSet(3pm)					User Contributed Perl Documentation				       XPath::NodeSet(3pm)

NAME
XML::XPath::NodeSet - a list of XML document nodes DESCRIPTION
An XML::XPath::NodeSet object contains an ordered list of nodes. The nodes each take the same format as described in XML::XPath::XMLParser. SYNOPSIS
my $results = $xp->find('//someelement'); if (!$results->isa('XML::XPath::NodeSet')) { print "Found $results "; exit; } foreach my $context ($results->get_nodelist) { my $newresults = $xp->find('./other/element', $context); ... } API
new() You will almost never have to create a new NodeSet object, as it is all done for you by XPath. get_nodelist() Returns a list of nodes. See XML::XPath::XMLParser for the format of the nodes. string_value() Returns the string-value of the first node in the list. See the XPath specification for what "string-value" means. to_literal() Returns the concatenation of all the string-values of all the nodes in the list. get_node($pos) Returns the node at $pos. The node position in XPath is based at 1, not 0. size() Returns the number of nodes in the NodeSet. 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 $nodeset to the end of the current list. 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 $nodeset to the front of the current list. perl v5.10.1 2002-09-02 XPath::NodeSet(3pm)

Check Out this Related Man Page

XPath::NodeSet(3)					User Contributed Perl Documentation					 XPath::NodeSet(3)

NAME
XML::XPath::NodeSet - a list of XML document nodes DESCRIPTION
An XML::XPath::NodeSet object contains an ordered list of nodes. The nodes each take the same format as described in XML::XPath::XMLParser. SYNOPSIS
my $results = $xp->find('//someelement'); if (!$results->isa('XML::XPath::NodeSet')) { print "Found $results "; exit; } foreach my $context ($results->get_nodelist) { my $newresults = $xp->find('./other/element', $context); ... } API
new() You will almost never have to create a new NodeSet object, as it is all done for you by XPath. get_nodelist() Returns a list of nodes. See XML::XPath::XMLParser for the format of the nodes. string_value() Returns the string-value of the first node in the list. See the XPath specification for what "string-value" means. to_literal() Returns the concatenation of all the string-values of all the nodes in the list. get_node($pos) Returns the node at $pos. The node position in XPath is based at 1, not 0. size() Returns the number of nodes in the NodeSet. 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 $nodeset to the end of the current list. 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 $nodeset to the front of the current list. perl v5.18.2 2002-09-02 XPath::NodeSet(3)
Man Page

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sub routine call

in windows machine... C:\2\test>perl -version This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) ------------------------------------------ what is the difference b\w subroutine calls: sub_routine_name("-----"); and ... (2 Replies)
Discussion started by: sekar sundaram
2 Replies

2. Shell Programming and Scripting

shift and push question in perl

hi, another perl question, I don't understand the below while (<FILE>) { push @last5, $_; #add to the end shift @last5 if @last5 > 5 ; #take from the beginning } can someone please explain to me how does shift @last5 if @last5 > 5 is taking last 5 lines from... (5 Replies)
Discussion started by: hankooknara
5 Replies

3. Shell Programming and Scripting

Getting the value of a line, that changes place

Hi I am trying to get the value of several results in a file called seq032.diag. The values I am looking for is down under Smooth Tracking nodes and is for g01r01 g02r01 s01t02 etc etc. The problem is that when I try to use look for text and tail etc, it works fine in one result file. In... (1 Reply)
Discussion started by: Navigatorchief
1 Replies

4. UNIX for Dummies Questions & Answers

optimizing - to find the number of occurrence

Hi, I need to find the number of occurrence of string in a file, for ex: >cat filename abc abc def ghi ghi ghi ghi abc abc >output would be abc 4 def 1 (10 Replies)
Discussion started by: matrixmadhan
10 Replies

5. Shell Programming and Scripting

Bash XML Parsing using Perl XPath

I have a bash script that needs to read input from an XML file, which includes varying numbers of a certain type of child node. I want to be able to iterate through all the child nodes of a given parent. I installed the Perl XML-XPath package from search.cpan.org. Once it's installed, from bash,... (4 Replies)
Discussion started by: jfmorales
4 Replies

6. Homework & Coursework Questions

perl script card shuffle

Hi, I have a problem that pertains to using perl script pop,shift,push only to shuffle a card and print out 5 top listed numbers. HW problem from oreilly school of technology linux/unix course instructor name kelly hoover #!/usr/bin/perl @startingdeck = ("A H","2 H","3 H","4 H","5... (1 Reply)
Discussion started by: flyganji
1 Replies

7. What is on Your Mind?

A simpler XML tool

We've been getting a lot of XML questions lately, and I suspect it's only going to get worse better ... Normal shell utilities just can't handle it and the "proper" solutions, do-everything perl modules or things like xmlstarlet, just make my head ache. Started coding something tonight. What... (10 Replies)
Discussion started by: Corona688
10 Replies

8. IP Networking

Query about node activity

Hi, im just trying to find my way out. can anyone tell me where do nodes keep their info about which other nodes they've interacted with and when? or just where do they store details about which nodes have exchanged info with them, which nodes do they interact with? are the contents of such file... (3 Replies)
Discussion started by: still.dedes3
3 Replies