Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xml::xpath::nodeset(3) [mojave 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)

Check Out this Related 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)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

i-nodes

first off, i am new to unix so please bear with me. i was reading somewhere that if your i-nodes get critical that it can slow your network down. what are i-nodes and when do they become a critical number? this is what mine states: / (/dev/root ): 777058 blocks 569290 i-nodes... (4 Replies)
Discussion started by: djatwork
4 Replies

2. UNIX for Dummies Questions & Answers

broken pipe?

Hi there, I try to use: > find * | ls but it just gave me one level of ' ls '. and it said: > find * | ls dir1 dir2 f1 f2 f3 Broken Pipe > what is broken pipe? how can i fix it? thks Gusla (3 Replies)
Discussion started by: gusla
3 Replies

3. Shell Programming and Scripting

help with perl

need help with a perl script which reads the user name and uses the /etc/password file as a data source to match the username i.e. #!/usr/local/bin/perl print "\nPlease enter user number: "; $id = <STDIN>; #match $id with /etc/password file print id and home directory :confused: (5 Replies)
Discussion started by: homerj546
5 Replies

4. Shell Programming and Scripting

another perl question

I copy and paste from the book but this thing is not working. I cannot figure out what is wrong with myline 9.. can someone please tell me # cat ./sort4.pl #!/usr/bin/perl -w use strict; use warnings; my $input = shift; my $output = shift; open(IN, '<', $input) or die... (4 Replies)
Discussion started by: hankooknara
4 Replies

5. 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

6. Shell Programming and Scripting

form validation with perl

Hey guys, I'm just messing around with a perl webpage. The idea is to make a simple validation form that will later insert a record into my DVD database. it's all very basic at the moment, and I worked up my script from the form validation example I found on this website:... (5 Replies)
Discussion started by: LNC
5 Replies

7. Shell Programming and Scripting

if match found go to a particular line in perl

Hello Experts, I am newbie to perl, just curious to know how to do the following in perl. suppose I ve a txt file like below. when it founds "*Main Start" Then go to "*Main End,,,,,,,," patteren and just collect the number from the previous line of "*Main End,,,,,,," pattern . In my... (17 Replies)
Discussion started by: user_prady
17 Replies

8. Shell Programming and Scripting

Fileserver in Perl via xinetd - bad XML output

Hello there, I hope I took the right forum... I never worked with Perl, but now I have to get a simple fileserver running. The goal is to deliver an XML file (it's part of a new security model in the Flashplayer, see Adobe - Developer Center : Setting up a socket policy file server for more... (9 Replies)
Discussion started by: blemmo
9 Replies

9. 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

10. Shell Programming and Scripting

Convert UTC time to Date

Hi, I need to convert a number representing time in UTC seconds to a date. Ex: 3BE0082C --> Oct 31 2001 15:31:08 I have tried the following perl command but it gives a different answer? $ perl -e 'print scalar localtime(shift), "\n"' 3BE00B2C Thu Jan 1 03:00:03 1970 Any ideas? Thanks. :) (10 Replies)
Discussion started by: GNMIKE
10 Replies

11. Shell Programming and Scripting

Shuffling 'cards' using perl.

I would be very grateful if someone could help me with this; using pop, shift, push, and the starting code below, I'd like a script that sufficiently "shuffles" a simulated deck of cards before printing the top five cards. #!/usr/bin/perl @startingdeck = ("A H","2 H","3 H","4 H","5 H","6... (9 Replies)
Discussion started by: DemonixX
9 Replies

12. 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

13. 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

14. Programming

Perl list file

Hi all I am looking for a way to list files in a directoy using perl but then exlude some of the results i've got this to list the files, but how can exclude some of the results #!/usr/bin/perl $d = "/data"; opendir(DIR, $d); foreach my $file (readdir(DIR)) { print "Version:... (5 Replies)
Discussion started by: ab52
5 Replies

15. 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