xmltagcnt

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

 

NAME

xmltagcnt - count the tags in XML data file

 

SYNOPSIS

xmltagcnt -i input filename [-o output filename] [-z]

 

DESCRIPTION

Prints count of tags contained in XML data specified from the input in xmlTable format.

 

PARAMETERS

-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.

 

FILE OPTIONS

-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.
-z zip archive
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.

 

USAGE

Input file - dat.xml:
<?xml version="1.0" encoding="euc-jp"?>
<purchase year="2001">
<title>Customer Purchase History </title>
<comment>Artificial data is used for demonstration purpose</comment>

  <CustomerID>

    <Date>

      <row no="1">

        <Amount>273</Amount>

      </row>

      <row no="2">

        <Amount>333</Amount>

      </row>

      <row no="3">

        <Amount>382</Amount>

      </row>

      <row no="4">

        <Amount>414</Amount>

      </row>

      <row no="5">

        <Amount>688</Amount>

      </row>

    </Date>

    <Date>

     <row no="1">

        <Amount>1023</Amount>

      </row>

      <row no="2">

        <Amount>315</Amount>

      </row>

Example 1. xmltagcnt -i dat.xml -o rsl.xt

Output file - rsl.xt:


<?xml version="1.0" encoding="euc-jp"?>
<xmltbl version="1.00">
<header>
<field no="1">
<name>¥Ñ¥¹Ì¾</name>
</field>
<field no="2">
<name>·ï¿ô</name>
</field>
<recCnt>0</recCnt>
</header>
<body><![CDATA[
/purchase 2
/purchase@year 1
/purchase/CustomerID 1022
/purchase/CustomerID/Date 5971
/purchase/CustomerID/Date/row 38734
/purchase/CustomerID/Date/row@no 38733
/purchase/CustomerID/Date/row/Amount 38734
/purchase/title 2
/purchase/comment 2
]]></body>
</xmltbl>

 

SEE ALSO

xmltree(1) For complete documentation and tutorial of xmltagcnt and other commands, please visit http://musashien.sourceforge.net

 

BUG REPORT

If you find a bug in xmltagcnt, 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:51 GMT, June 24, 2003