Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xml::grove::sub(3) [centos man page]

XML::Grove::Sub(3)					User Contributed Perl Documentation					XML::Grove::Sub(3)

NAME
XML::Grove::Sub - run a filter sub over a grove SYNOPSIS
use XML::Grove::Sub; # Using filter method on XML::Grove::Document or XML::Grove::Element: @results = $grove_object->filter(&sub [, ...]); # Using an XML::Grove::Sub instance: $filterer = XML::Grove::Sub->new(); @results = $grove_object->accept($filterer, &sub [, ...]); DESCRIPTION
"XML::Grove::Sub" executes a sub, the filter, over all objects in a grove and returns a list of all the return values from the sub. The sub is called with the grove object as it's first parameter and passing the rest of the arguments to the call to `"filter()"' or `"accept()"'. EXAMPLE
The following filter will return a list of all `"foo"' or `"bar"' elements with an attribute `"widget-no"' beginning with `"A"' or `"B"'. @results = $grove_obj->filter(sub { my $obj = shift; if ($obj->isa('XML::Grove::Element') && (($obj->{Name} eq 'foo') || ($obj->{Name} eq 'bar')) && ($obj->{Attributes}{'widget-no'} =~ /^[AB]/)) { return ($obj); } return (); }); AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us SEE ALSO
perl(1), XML::Grove(3), Data::Grove::Visitor(3) Extensible Markup Language (XML) <http://www.w3c.org/XML> perl v5.16.3 1999-09-02 XML::Grove::Sub(3)

Check Out this Related Man Page

XML::Grove::Sub(3pm)					User Contributed Perl Documentation				      XML::Grove::Sub(3pm)

NAME
XML::Grove::Sub - run a filter sub over a grove SYNOPSIS
use XML::Grove::Sub; # Using filter method on XML::Grove::Document or XML::Grove::Element: @results = $grove_object->filter(&sub [, ...]); # Using an XML::Grove::Sub instance: $filterer = XML::Grove::Sub->new(); @results = $grove_object->accept($filterer, &sub [, ...]); DESCRIPTION
"XML::Grove::Sub" executes a sub, the filter, over all objects in a grove and returns a list of all the return values from the sub. The sub is called with the grove object as it's first parameter and passing the rest of the arguments to the call to `"filter()"' or `"accept()"'. EXAMPLE
The following filter will return a list of all `"foo"' or `"bar"' elements with an attribute `"widget-no"' beginning with `"A"' or `"B"'. @results = $grove_obj->filter(sub { my $obj = shift; if ($obj->isa('XML::Grove::Element') && (($obj->{Name} eq 'foo') || ($obj->{Name} eq 'bar')) && ($obj->{Attributes}{'widget-no'} =~ /^[AB]/)) { return ($obj); } return (); }); AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us SEE ALSO
perl(1), XML::Grove(3), Data::Grove::Visitor(3) Extensible Markup Language (XML) <http://www.w3c.org/XML> perl v5.10.1 1999-10-23 XML::Grove::Sub(3pm)
Man Page

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert XML to Data File in Shell Script

Hi All, I will be getting a huge XML file with a lot of records in it. I need to convert it into multiple data files. SAMPLE XML FILE <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <ProductSalesHierachy> - <Portfolios> - <Portfolio productCode="P1"> ... (8 Replies)
Discussion started by: ragha81
8 Replies

2. Shell Programming and Scripting

parse special character in the line

Hi all, I have a file with some module names as below. Font::AFM Data::Grove ---> libxml-perl Net::LDAP ---> perl-ldap DBI XML .... ... .... and so on ... The file has some lines with the character " -->" . Now how can I cut only the last column of the line wherever "-->" is... (4 Replies)
Discussion started by: vijaya2006
4 Replies

3. Shell Programming and Scripting

Extract only required elements from XML.

Hi , I have an XML like this. <Request> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <version>v44</version><messageId>7247308192</messageId><timeToLive>72000000000</timeToLive> </Request>. I want to extract on version and messageId. As in my output... (13 Replies)
Discussion started by: chetan.c
13 Replies

4. UNIX for Dummies Questions & Answers

XML to TXT or CSV

Hi all, I am new to unix and even newer to XML :wall: I have a dataset which I need to work on and extract data from but I cant even see things. its a XML file which i need to analyse and return the results in xml as well but need to filter some of them like i would do with excel file so not... (7 Replies)
Discussion started by: A-V
7 Replies

5. Shell Programming and Scripting

Extract values from an XML File

Hi, I need to capture all the attributes with delete next to it. The source XML file is attached. The output should contain something like this below: Attributes = legacyExchangeDN Action = Delete Username = Hero Joker Loginid = joker09 OU =... (4 Replies)
Discussion started by: prvnrk
4 Replies

6. Shell Programming and Scripting

Phrase XML with Huge Data

HI Guys, I have Big XML file with Below Format :- Input :- <pokl>MKL=1,FN=1,GBNo=B10C</pokl> <d>192</d> <d>315</d> <d>35</d> <d>0,7,8</d> <pokl>MKL=1,dFN=1,GBNo=B11C</pokl> <d>162</d> <d>315</d> <d>35</d> <d>0,5,6</d> <pokl>MKL=1,dFN=1,GBNo=B12C</pokl> <d>188</d> (4 Replies)
Discussion started by: pareshkp
4 Replies

7. UNIX for Beginners Questions & Answers

Script to populate (2) values in .XML

Good Afternoon Team - I"m asking for assistance on a piece of code to populate two values in an XML file. I have it working perfectly using CScript for DOS, but I have a need to do that same process in a Linux environment. Here is the XML I need to modify: <?xml version="1.0"... (5 Replies)
Discussion started by: SIMMS7400
5 Replies