Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Xmllint pretty print, batch files Post 302742053 by Yoda on Monday 10th of December 2012 12:43:11 PM
Old 12-10-2012
How about a for loop with seq:
Code:
for SEQ in $( seq -f "%02g" 1 20 )
do
   xmllint --format file${SEQ}.xml > pretty_file${SEQ}.xml
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to batch & print hpgl files to xerox device

have electronic files from customer with .gl extension; are hpgl files originating from Unix. Need utility to open, batch and print in directory order on xerox docutech. Any ideas? Help greatly appreciated. (5 Replies)
Discussion started by: theresa
5 Replies

2. UNIX for Dummies Questions & Answers

Deleting a batch of print jobs

Hi Guys I have over 2000+ print jobs in one queue which I would like to delete. Is there away in AIX 4.3 that I can delete the whole print jobs at ocne. Instead of one at a time. Thanks (1 Reply)
Discussion started by: orvelb
1 Replies

3. Programming

I am pretty new to this

Ok, so I need to make a program using PICO. Here is the assignment, if anyone knows how to do this please show me. Thanks. Acme Paints, a well-respected local paint store, is having their big End-Of-Winter Paint Sale. They have way too much red, green, yellow, and blue paint on hand in their... (1 Reply)
Discussion started by: thescene
1 Replies

4. UNIX for Advanced & Expert Users

iconv and xmllint

Here is my question, volume of records processed : 5M ( approx ) Its basically very simple operation that am trying to do and I had achieved the output that am interested. What am looking for really is to improve the performance, an optimized way to do that. with respect to iconv, am... (3 Replies)
Discussion started by: matrixmadhan
3 Replies

5. Shell Programming and Scripting

xmllint output to a file

Hello All, I have an XML file which has some errors in its tag definition according to an xsd. When i validate this xml file against an xsd, i wish to only take the errors in a file and not the complete xml. for eg. Raman.xml has some errors induced in it. RamanValidator.xsd holds the schema... (5 Replies)
Discussion started by: damansingh
5 Replies

6. UNIX for Dummies Questions & Answers

Batch Renaming of Files

Hello all, thanks for your time (and this forum, what an awesome resource for newbs like myself!) Anyways, I've been given the task of importing content from a directory of about...7000 HTML files. They are all named appropriately and broken down by name depending on what book they belong too.... (8 Replies)
Discussion started by: gratefulhokie
8 Replies

7. Shell Programming and Scripting

Executing a batch of files within a shell script with option to refire the individual files in batch

Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below. I am on a solaris server btw. Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose. ... (2 Replies)
Discussion started by: goddevil
2 Replies

8. Shell Programming and Scripting

Need to exclude .NFSxxx files in clear old files batch script

I am new to Shell Scripting and need some help. The following batch job has been failing for me due to the .nfsxxx files in use. I need to know how to modify the following script to exclude the .nfsxxx files so this batch job will not fail on me. I have done lots of googling and keep coming back... (2 Replies)
Discussion started by: kimberlyg2007
2 Replies

9. Shell Programming and Scripting

Accessing files in batch

hai, I have a list of files having extension .sy in a folder. I want to find such files and print the first two columns of the files to new extension .tmp (1 Reply)
Discussion started by: sreejithalokkan
1 Replies

10. Shell Programming and Scripting

Help with xmllint

Have like 50 xml files in a folder. They all have a Node named <Number>.How to display the values of <Number> with the count and filename in the folder. I am using Mac . (7 Replies)
Discussion started by: Anethar
7 Replies
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)
All times are GMT -4. The time now is 07:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy