xt2xml

Section: User Commands (1)
Updated: 2002-10-26
Index Return to Main Contents

 

NAME

xt2xml - convert XML Table to XML Data

 

SYNOPSIS

xt2xml [-k attribute list] [-L row tagname] [-R root tagname] [-q] [-i input filename] [-o output filename] [-z] [-T directory of work file]

 

DESCRIPTION

This command converts xmlTable formatted data to xml format.

 

PARAMETERS

-k attribute list
attributes to be nested:attribute name [option]
-L row tagname
tag representing a line:attribute name [option]
-R root tagname
specifes a root tagname

 

FILE OPTIONS

-i input filename
If a suffix of the filename is '.gz', the command acts as a filter, extracting the compressed file for processing. The command will read the file as standard input when "-i" is not specified.
-o output filename
If a suffix of the filename is '.gz', the command automatically returns the output data in zip archive. When "-o" is not specified, the result will sent to standard output.
-q sequential transaction:
When this option specified with -k parameter, the command process the input data following the original sequence of the lines, instead of processing after sorting the field specified by -k parameter.
-z compress the standard output to zip archive:
When the option "-o" is not given and "-z" is specified, the output will be compressed as zip archive.
-T directory of work file
the directory name for temporal files used in this command.

 

USAGE

Input file - dat.txt:
CustomerID BirthDate Gender
A00001 19610615 F
A00002 19571029 F
A00003 19790608 F
A00004 19530110 F
A00005 19790712 F
A00006 19570421 M

Example 1. Convert data in xml table format to xml format.
e.g. xt2xml -i dat.xt -o dat.xml Output file - dat.xml


<?xml version="1.0" encoding="euc-jp"?>
<root>
<title>Customer Master File</title>

  <CustomerID>A00001</CustomerID>

  <BirthDate>19610615</BirthDate>

  <Gender>F</Gender>

  <CustomerID>A00002</CustomerID>

  <BirthDate>19571029</BirthDate>

  <Gender>F</Gender>

  <CustomerID>A00003</CustomerID>

  <BirthDate>19790608</BirthDate>

  <Gender>F</Gender>

Example 2. Convert dat.xt to XML format with CustomerID as the key tag, then enclose the data with a root tag "Membership in year 2003"
e.g. xt2xml -k CustomerID Membership:year=2003 -i dat.xt -o dat.xml Output file - dat.xml


<?xml version="1.0" encoding="euc-jp"?>
<Membership year="2003">
<title>Customer Master File¼</title>

  <CustomerID>

    <BirthDate>19610615</BirthDate>

    <Gender>F</Gender>

  </CustomerID>

  <CustomerID>

    <BirthDate>19571029</BirthDate>

    <Gender>F</Gender>

  </CustomerID>

  <CustomerID>

    <BirthDate>19790608</BirthDate>

    <Gender>F</Gender>

  </CustomerID>

  ..

  .

Example 3. Convert dat.xt to XML format with CustomerID and Birthdate as the key tag, and enclosed the nested tag within the key tag with a row tag.
e.g. xt2xml -k CustomerID,BirthDate -R Membership:year=2003 -L row:no -i dat.xt -o dat.xml Output file - dat.xml


<?xml version="1.0" encoding="euc-jp"?>
<Membership year="2003">
<title>Customer Master File¼</title>

  <CustomerID>

    <BirthDate>

      <row no="1">

        <Gender>F</Gender>

      </row>

    </BirthDate>

  </CustomerID>

  <CustomerID>

    <BirthDate>

      <row no="1">

        <Gender>F</Gender>

      </row>

    </BirthDate>

  </CustomerID>

  ..

  . 

 

SEE ALSO

xml2xt(1), xt2txt(1), txt2xt(1) For complete documentation and tutorial of xt2xml and other commands, please visit http://musashi.adm.osaka-sandai.ac.jp.

 

BUG REPORT

If you find a bug in xt2xml, please send electronic mail to musashi@adm.osaka-sandai.ac.jp. Before sending a bug report, please verify that you have the lastest version of MUSASHI. Read this manual carefully to ensure the error is not caused by a quirk in the language.

 

AUTHORS

Yukinobu Hamuro, Naoki Katoh, Katsutoshi Yada, Stephane Cheung


 

Index

NAME
SYNOPSIS
DESCRIPTION
PARAMETERS
FILE OPTIONS
USAGE
SEE ALSO
BUG REPORT
AUTHORS

This document was created by man2html, using the manual pages.
Time: 22:43:52 GMT, June 24, 2003