The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<HTML>
<HEAD>
<TITLE>stag-splitter</TITLE>
<LINK REV="made" HREF="mailto:feedback@suse.de">
</HEAD>

<BODY>

<A NAME="__index__"></A>
<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#name">NAME</A></LI>
	<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
	<LI><A HREF="#description">DESCRIPTION</A></LI>
	<LI><A HREF="#usage">USAGE</A></LI>
</UL>
<!-- INDEX END -->

<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>stag-splitter.pl - splits a stag file into multiple files</P>
<P>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
  stag-splitter.pl -split person -name social_security_no file.xml</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>Splits a file using a user specified parser (default xml) around a
specified split node, naming each file according to the name argument</P>
<P>the files will be named anonymously, unless the '-name' switch is specified; this will use the value of the specified element as the filename</P>
<P>eg; if we have</P>
<PRE>
  &lt;top&gt;
    &lt;a&gt;
      &lt;b&gt;foo&lt;/b&gt;
      &lt;c&gt;yah&lt;/c&gt;
      &lt;d&gt;
        &lt;e&gt;xxx&lt;/e&gt;
      &lt;/d&gt;
    &lt;/a&gt;
    &lt;a&gt;
      &lt;b&gt;bar&lt;/b&gt;
      &lt;d&gt;
        &lt;e&gt;wibble&lt;/e&gt;
      &lt;/d&gt;
    &lt;/a&gt;
  &lt;/top&gt;</PRE>
<P>if we run</P>
<PRE>
  stag-splitter.pl -split a -name b</PRE>
<P>it will generate two files, ``foo.xml'' and ``bar.xml''</P>
<P>input format can be 'xml', 'sxpr' or 'itext' - if this is left blank
the format will be guessed from the file suffix</P>
<P>the output format defaults to the same as the input format, but
another can be chosen.</P>
<P>files go in the current directory, but this can be overridden with the
'-dir' switch</P>
<P>
<HR>
<H1><A NAME="usage">USAGE</A></H1>
<PRE>
   stag-splitter.pl [-split &lt;ELEMENT-NAME&gt;] [-name &lt;ELEMENT-NAME&gt;] [-dir &lt;DIR&gt;] [-format &lt;INPUT-FORMAT&gt;] [-outformat &lt;OUTPUT-FORMAT&gt;] &lt;FILENAMES&gt;</PRE>
<DL>
<DT><STRONG><A NAME="item_%2Dp%7Cparser_FORMAT">-p|parser FORMAT</A></STRONG><BR>
<DD>
FORMAT is one of xml, sxpr or itext, or the name of a perl module
<P>xml assumed as default</P>
<P></P>
<DT><STRONG><A NAME="item_%2Dw%7Cwriter_FORMAT">-w|writer FORMAT</A></STRONG><BR>
<DD>
FORMAT is one of xml, sxpr or itext, or the name of a perl module
<P></P>
<DT><STRONG><A NAME="item_%2Dsplit%7Cs_NODE">-split|s NODE</A></STRONG><BR>
<DD>
node to split on
<P></P>
<DT><STRONG><A NAME="item_%2Dname%7Cn_NODE">-name|n NODE</A></STRONG><BR>
<DD>
field/element to use when naming files
<P>will use surrogate IDs if this argument not specified</P>
<P></P>
<DT><STRONG><A NAME="item_%2Ddir%7Cd_DIR">-dir|d DIR</A></STRONG><BR>
<DD>
write files to this directory
<P></P></DL>

</BODY>

</HTML>