Creating statistics for a given XML instance

Subject: Creating statistics for a given XML instance
From: "Wegmann, Frank" <Frank.Wegmann@xxxxxxxxxxxxxx>
Date: Fri, 22 Sep 2000 12:20:03 +0200
I wonder if it is possible with XSL to create a statistics for
a given XML file that tells which element has been used how often
along with the usage of every attribute.

Given a XML sample file like this:

<elem1 att1="val1">
 <elem2 att1="val2" att2="val10">
  <elem3 att3="val"/>
  <elem3 att2="val"/>
  <elem4>
    <elem5 att1="val3" att4="val20"/>
    <elem5 att1="val2" att2="val2" att4="val21"/>
  </elem4>
 </elem2>
</elem1>

I want to end in a table that reports the number of uses of these elements
and attributes:

	Total	att1 att2 att3 att4 att
elem1	  1     1    0    0    0   0
elem2   1     1    1    0    0   0
elem3   2     0    1    1    0   0
elem4   1     0    0    0    0   0
elem5   2     2    1    0    2   0

As far as I could search the archive, I haven't yet seen a solution for
that kind of problem. Or did I miss something?

Frank

--
<Frank.Wegmann at softwareag.com>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread