Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

stag-parse(1p) [debian man page]

STAG-PARSE(1p)						User Contributed Perl Documentation					    STAG-PARSE(1p)

NAME
stag-parse - parses a file and fires events (e.g. sxpr to xml) SYNOPSIS
# convert XML to IText stag-parse -p xml -w itext file1.xml file2.xml # use a custom parser/generator and a custom writer/generator stag-parse -p MyMod::MyParser -w MyMod::MyWriter file.txt DESCRIPTION
script wrapper for the Data::Stag modules feeds in files into a parser object that generates nestarray events, and feeds the events into a handler/writer class ARGUMENTS
-p|parser FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module this is the class that parsers the input file(s) and generates stag events xml assumed as default -w|writer FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module this is the class that catches the events thrown by the parser; it can be any class, but the class is typically a writer xml assumed as default -o|out FILE the writer will use this file (defaults to STDOUT) -e|errf FILE file to store parse error handler output -errhandler FORMAT/MODULE FORMAT is one of xml, sxpr or itext, or the name of a perl module all parse error events go to this module -r|root NODE_NAME if this is specified, NODE_NAME becomes the root of the stag tree, and anything that was previously the root is placed below this. this happens automatically if more than one file is parsed (because there can only be one tree root) -color Works only if the output handler is able to provide ASCII-colors (currently supported for itext and xml) SEE ALSO
Data::Stag This script is a wrapper for the method Data::Stag->parse() perl v5.10.0 2008-12-23 STAG-PARSE(1p)

Check Out this Related Man Page

STAG-SPLITTER(1p)					User Contributed Perl Documentation					 STAG-SPLITTER(1p)

NAME
stag-splitter - splits a stag file into multiple files SYNOPSIS
stag-splitter -split person -name social_security_no file.xml DESCRIPTION
Splits a file using a user specified parser (default xml) around a specified split node, naming each file according to the name argument the files will be named anonymously, unless the '-name' switch is specified; this will use the value of the specified element as the filename eg; if we have <top> <a> <b>foo</b> <c>yah</c> <d> <e>xxx</e> </d> </a> <a> <b>bar</b> <d> <e>wibble</e> </d> </a> </top> if we run stag-splitter -split a -name b it will generate two files, "foo.xml" and "bar.xml" input format can be 'xml', 'sxpr' or 'itext' - if this is left blank the format will be guessed from the file suffix the output format defaults to the same as the input format, but another can be chosen. files go in the current directory, but this can be overridden with the '-dir' switch USAGE
stag-splitter [-split <ELEMENT-NAME>] [-name <ELEMENT-NAME>] [-dir <DIR>] [-format <INPUT-FORMAT>] [-outformat <OUTPUT-FORMAT>] <FILENAMES> -p|parser FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module xml assumed as default -w|writer FORMAT FORMAT is one of xml, sxpr or itext, or the name of a perl module -split|s NODE node to split on -name|n NODE field/element to use when naming files will use surrogate IDs if this argument not specified -dir|d DIR write files to this directory perl v5.10.0 2008-12-23 STAG-SPLITTER(1p)
Man Page