I have some xml files that got created by exporting a website from RedDot. I would like to extract the cost,
course number, description, and meeting information.
<?xml version="1.0" encoding="UTF-16" standalone="yes" ?>
- <PAG PAG0="3AE6FCFD86D34896A82FCA3B7B76FF90" PAG3="525312"... (3 Replies)
Hi,
Within a UNIX shell script I need to extract a value from an XML field. The field will contain different values but will always be 6 digits in length. E.g.:
<provider-id>999999</provider-id>
I've tried various ways but no luck. Any ideas how I might get the provider id (in this case... (2 Replies)
Hi ,
I have one xml file contains more than 60 lines. I need to extract some details from the file and store it in new file.Not the whole file
Please find the xml file below:
<?xml version="1.0" encoding="UTF-8"?>
<DeploymentDescriptors xmlns="http://www.tibco.com/xmlns/dd">
... (6 Replies)
Hello All,
I want to write a shell script for extracting a content from a xml file
the xml file looks like this:
<Variable name="moreAxleInfo">
<type>
<Table>
<type>
<NamedType>
<type>
<TypeRef... (11 Replies)
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)
Hello,
Hope you are doing fine. I have an log file which looks like as follows:
Some junk text1
Date: Thu Mar 15 13:38:46 CDT 2012 DATA SENT SUCCESSFULL:
Some jun text 2
Date: Thu Mar 15 13:38:46 CDT 2012 DATA SENT SUCCESSFULL: ... (3 Replies)
Hi ,
I have input file as XML. following are input data
#complex.xml
<?xml version="1.0" encoding="UTF-8"?>
<TEST_doc xmlns="http://www.w3.org/2001/XMLSchema-instance">
<ENTRY uid="123456">
<protein>
<name>PROT001</name>
<organism>Human</organism>
... (1 Reply)
XML::SAX::Pipeline(3pm) User Contributed Perl Documentation XML::SAX::Pipeline(3pm)NAME
XML::SAX::Pipeline - Manage a linear pipeline of SAX processors
SYNOPSIS
use XML::SAX::Machines qw( Pipeline ); ## Most common way
use XML::Fitler::Foo;
my $m = Pipeline(
XML::Filter::Foo->new, ## Create it manually
"XML::Filter::Bar", ## Or let Pipeline load & create it
"XML::Filter::Baz",
{
## Normal options
Handler => $h,
}
);
## To choose the default parser automatically if XML::Filter::Foo
## does not implement a parse_file method, just pretend the Pipeline
## is a parser:
$m->parse_file( "blah" );
## To feed the pipeline from an upstream processor, treat it like
## any other SAX filter:
my $p = Some::SAX::Generator->new( Handler => $m );
## To read a file or the output from a subprocess:
my $m = Pipeline( "<infile.txt" );
my $m = Pipeline( "spew_xml |" );
## To send output to a file handle, file, or process:
my $m = Pipeline( ..., *STDOUT );
my $m = Pipeline( ..., ">outfile.txt" );
my $m = Pipeline( ..., "| xmllint --format -" );
DESCRIPTION
An XML::SAX::Pipeline is a linear sequence SAX processors. Events passed to the pipeline are received by the "Intake" end of the pipeline
and the last filter to process events in the pipeline passes the events out the "Exhaust" to the filter set as the pipeline's handler:
+-----------------------------------------------------------+
| An XML:SAX::Pipeline |
| Intake |
| +---------+ +---------+ +---------+ Exhaust |
--+-->| Stage_0 |--->| Stage_1 |-->...-->| Stage_N |----------+----->
| +---------+ +---------+ +---------+ |
+-----------------------------------------------------------+
As with all SAX machines, a pipeline can also create an ad hoc parser (using XML::SAX::ParserFactory) if you ask it to parse something and
the first SAX processer in the pipeline can't handle a parse request:
+-------------------------------------------------------+
| An XML:SAX::Pipeline |
| Intake |
| +--------+ +---------+ +---------+ Exhaust |
| | Parser |-->| Stage_0 |-->...-->| Stage_N |----------+----->
| +--------+ +---------+ +---------+ |
+-------------------------------------------------------+
or if you specify an input file like so:
my $m = Pipeline(qw(
<input_file.xml
XML::Filter::Bar
XML::Filter::Baz
));
Pipelines (and machines) can also create ad hoc XML::SAX::Writer instances when you specify an output file handle (as shown in the
SYNOPSIS) or an output file:
my $m = Pipeline(qw(
XML::Filter::Bar
XML::Filter::Baz
>output_file.xml
));
And, thanks to Perl's magic open (see perlopentut), you can read and write from processes:
my $m = Pipeline(
"gen_xml.pl |",
"XML::Filter::Bar",
"XML::Filter::Baz",
"| consume_xml.pl",
);
This can be used with an XML::SAX::Tap to place a handy debugging tap in a pipeline (or other machine):
my $m = Pipeline(
"<input_file.xml"
"XML::Filter::Bar",
Tap( "| xmllint --format -" ),
"XML::Filter::Baz",
">output_file.xml",
);
METHODS
See XML::SAX::Machine for most of the methods.
new
my $pipeline = XML::SAX::Pipeline->new( @processors, \%options );
Creates a pipeline and links all of the given processors together. Longhand for Pipeline().
AUTHOR
Barrie Slaymaker <barries@slaysys.com>
COPYRIGHT
Copyright 2002, Barrie Slaymaker, All Rights Reserved.
You may use this module under the terms of the Artistic, GNU Public, or BSD licenses, your choice.
perl v5.10.0 2009-06-11 XML::SAX::Pipeline(3pm)