.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.if !\nF .nr F 0
.if \nF>0 \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    if !\nF==2 \{\
.        nr % 0
.        nr F 2
.    \}
.\}
.\" ========================================================================
.\"
.IX Title "STAG-SPLITTER 1"
.TH STAG-SPLITTER 1 "2009-12-14" "perl v5.24.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
stag\-splitter \- splits a stag file into multiple files
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\&  stag\-splitter \-split person \-name social_security_no file.xml
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Splits a file using a user specified parser (default xml) around a
specified split node, naming each file according to the name argument
.PP
the files will be named anonymously, unless the '\-name' switch is specified; this will use the value of the specified element as the filename
.PP
eg; if we have
.PP
.Vb 10
\&  <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>
.Ve
.PP
if we run
.PP
.Vb 1
\&  stag\-splitter \-split a \-name b
.Ve
.PP
it will generate two files, \*(L"foo.xml\*(R" and \*(L"bar.xml\*(R"
.PP
input format can be 'xml', 'sxpr' or 'itext' \- if this is left blank
the format will be guessed from the file suffix
.PP
the output format defaults to the same as the input format, but
another can be chosen.
.PP
files go in the current directory, but this can be overridden with the
\&'\-dir' switch
.SH "USAGE"
.IX Header "USAGE"
.Vb 1
\&   stag\-splitter [\-split <ELEMENT\-NAME>] [\-name <ELEMENT\-NAME>] [\-dir <DIR>] [\-format <INPUT\-FORMAT>] [\-outformat <OUTPUT\-FORMAT>] <FILENAMES>
.Ve
.IP "\-p|parser \s-1FORMAT\s0" 4
.IX Item "-p|parser FORMAT"
\&\s-1FORMAT\s0 is one of xml, sxpr or itext, or the name of a perl module
.Sp
xml assumed as default
.IP "\-w|writer \s-1FORMAT\s0" 4
.IX Item "-w|writer FORMAT"
\&\s-1FORMAT\s0 is one of xml, sxpr or itext, or the name of a perl module
.IP "\-split|s \s-1NODE\s0" 4
.IX Item "-split|s NODE"
node to split on
.IP "\-name|n \s-1NODE\s0" 4
.IX Item "-name|n NODE"
field/element to use when naming files
.Sp
will use surrogate IDs if this argument not specified
.IP "\-dir|d \s-1DIR\s0" 4
.IX Item "-dir|d DIR"
write files to this directory
