Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xml::parser::style::stream(3pm) [debian man page]

Parser::Style::Stream(3pm)				User Contributed Perl Documentation				Parser::Style::Stream(3pm)

NAME
XML::Parser::Style::Stream - Stream style for XML::Parser SYNOPSIS
use XML::Parser; my $p = XML::Parser->new(Style => 'Stream', Pkg => 'MySubs'); $p->parsefile('foo.xml'); { package MySubs; sub StartTag { my ($e, $name) = @_; # do something with start tags } sub EndTag { my ($e, $name) = @_; # do something with end tags } sub Characters { my ($e, $data) = @_; # do something with text nodes } } DESCRIPTION
This style uses the Pkg option to find subs in a given package to call for each event. If none of the subs that this style looks for is there, then the effect of parsing with this style is to print a canonical copy of the document without comments or declarations. All the subs receive as their 1st parameter the Expat instance for the document they're parsing. It looks for the following routines: o StartDocument Called at the start of the parse . o StartTag Called for every start tag with a second parameter of the element type. The $_ variable will contain a copy of the tag and the %_ variable will contain attribute values supplied for that element. o EndTag Called for every end tag with a second parameter of the element type. The $_ variable will contain a copy of the end tag. o Text Called just before start or end tags with accumulated non-markup text in the $_ variable. o PI Called for processing instructions. The $_ variable will contain a copy of the PI and the target and data are sent as 2nd and 3rd parameters respectively. o EndDocument Called at conclusion of the parse. perl v5.14.2 2011-05-25 Parser::Style::Stream(3pm)

Check Out this Related Man Page

Parser::Style::Stream(3)				User Contributed Perl Documentation				  Parser::Style::Stream(3)

NAME
XML::Parser::Style::Stream - Stream style for XML::Parser SYNOPSIS
use XML::Parser; my $p = XML::Parser->new(Style => 'Stream', Pkg => 'MySubs'); $p->parsefile('foo.xml'); { package MySubs; sub StartTag { my ($e, $name) = @_; # do something with start tags } sub EndTag { my ($e, $name) = @_; # do something with end tags } sub Characters { my ($e, $data) = @_; # do something with text nodes } } DESCRIPTION
This style uses the Pkg option to find subs in a given package to call for each event. If none of the subs that this style looks for is there, then the effect of parsing with this style is to print a canonical copy of the document without comments or declarations. All the subs receive as their 1st parameter the Expat instance for the document they're parsing. It looks for the following routines: o StartDocument Called at the start of the parse . o StartTag Called for every start tag with a second parameter of the element type. The $_ variable will contain a copy of the tag and the %_ variable will contain attribute values supplied for that element. o EndTag Called for every end tag with a second parameter of the element type. The $_ variable will contain a copy of the end tag. o Text Called just before start or end tags with accumulated non-markup text in the $_ variable. o PI Called for processing instructions. The $_ variable will contain a copy of the PI and the target and data are sent as 2nd and 3rd parameters respectively. o EndDocument Called at conclusion of the parse. perl v5.16.2 2011-05-24 Parser::Style::Stream(3)
Man Page

13 More Discussions You Might Find Interesting

1. Solaris

Modify Style Manager programmatically

My Java application runs on SunOS 5.8. Our use of a 3rd party class requires us to modify the Style Manager-Window setting "Allow Primary Windows On Top" - the default for this is on, we need to turn it off. Is there any way for our application, or our installation, to modify this setting? We... (0 Replies)
Discussion started by: ped52
0 Replies

2. Shell Programming and Scripting

Extracting tag values from XML using perl

Hi All, I'm trying to extract the values for the 'src' and 'alt' tags within an xml file. In the files that I'm searching, the tags are always enclosed within an 'img' tag. Typically: <img src="diwiz01.gif" width="576" height="254" alt="Out-of-process and In-process COM Objects"><bookmark... (3 Replies)
Discussion started by: Steve_altius
3 Replies

3. Shell Programming and Scripting

Want to use sed to add some parameters at the end of the line

Hello All, I have a doubt in sed, i want to add some parameter at the end of the tag inside a xml tag. how to i do that. so i want to add Results="true" value="high" inside the xml tag. Orignal <execute description="reboot"> <execute description="Stop Servlet"> After adding the... (5 Replies)
Discussion started by: asirohi
5 Replies

4. Shell Programming and Scripting

remove XML parent start and end tags in same file

Hi All, Requirement: remove start and end tag of parent element <DummyLevel> <level1> </level1> <level2> </level2> <level3> </level3> <level4> </level4> <level5> </level5> <level6> </level7> </DummyLevel> I have to delete the first <dummylevel> and last </DummyLevel> tags from... (7 Replies)
Discussion started by: dstage2006
7 Replies

5. Shell Programming and Scripting

how to find the end tag in xml file.

Hi, I am newbie. I wanted to know how to find the end tag in shell where I have multiple tags in xml like <tag name="x" version="1.0"> </tag> <tag name="x" version="1.0"> </tag> <tag name="x" version="1.0"> </tag> And I wanted to update depends this xml as (in side the tag <subtag ... (10 Replies)
Discussion started by: mariakumar3
10 Replies

6. Shell Programming and Scripting

replace 3rd field of space delimited text file

how to replace the 3rd colum? Each line begins similarly, but they all ends variously. XX YY 03 variable text here XX YY 03 more variable text here XX YY 03 even more variable text here really long setence XX YY 03 variable numbers also appear 03 11. 123 456 XX YY 03 the occasional comma,... (4 Replies)
Discussion started by: ajp7701
4 Replies

7. UNIX for Dummies Questions & Answers

Copy value and append value to a list

Hi, sorry if this has been asked before but I couldnt find it. Essentially I am trying to find a value next to an xml tag say abcd 12345678 the number 1-8 is the number i need to copy to a file of order numbers in my home directory ~/tn/ordernumbers.txt say for example there are 3 or... (3 Replies)
Discussion started by: rg01
3 Replies

8. Shell Programming and Scripting

RegeX to parse data from a txt file

Hi all the experts out there, I am totally new to perl and I was given an assignment by using Perl to find the 2nd element of each line in each curly bracket which made up of 5 elements. Expected result should like this: Type: VCC Pin_name: AK32,AL32,AH21,..... Type: NC Pin_name:... (2 Replies)
Discussion started by: killbanne
2 Replies

9. Shell Programming and Scripting

awk and or sed command to sum the value in repeating tags in a XML

I have a XML in which <Amt Ccy="EUR">3.1</Amt> tag repeats. This is under another tag <Main>. I need to sum all the values of <Amt Ccy=""> (Ccy may vary) coming under <Main> using awk and or sed command. can some help? Sample looks like below <root> <Main> ... (6 Replies)
Discussion started by: bk_12345
6 Replies

10. Shell Programming and Scripting

File Parser

Hi need help parsing a file. I have tag fields and values in a file with delimiter |. sample records from the file listed below 8=value|9=value|35=value|49=value|56=value|34=value|50=value|48=value|10=value 8=value|9=value|35=value|49=value|56=value|34=value|51=value|48=value|10=value... (2 Replies)
Discussion started by: subramanian
2 Replies

11. Shell Programming and Scripting

XML Parsing having optional tags into flat file

In xml file i have following data where some tags like<ChrgBr> may not be present in every next file. So i want these values to be stored in some variable like var1="405360,00" , var2="DEBT" and so on ,but if <ChrgBr> tag has no value or is absent var2 should have space like var2=" " so that i... (1 Reply)
Discussion started by: sandipgawale
1 Replies

12. Programming

Coding Style checking

Is there any opensource tool which can check the coding style use in C/C++ program. (3 Replies)
Discussion started by: zinat
3 Replies

13. What is on Your Mind?

Coding Style at UNIX.com forums

Hi, as I mentioned in this thread(https://www.unix.com/shell-programming-and-scripting/280737-awk-function-return-permutations-n-items-out-m.html), a helpful coding style may improve overall value and support for people who come here and want to learn things the participants from unix.com have... (2 Replies)
Discussion started by: stomp
2 Replies