Re: [xsl] statistice using xsl

Subject: Re: [xsl] statistice using xsl
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 18 Dec 2006 09:21:21 +0000
On 12/18/06, fatma helmy <fatmahelmy2000@xxxxxxxxx> wrote:
suppose i have the following xml file

<books>
<book>
   <author> joe </author>
  <author> mary </author>
</book>
<book>
   <author> joe </author>
  <author> hanz </author>
</book>
</books>

i need to perform the following statistics using xsl

<tag name="joe">
 <path> book/author </path> <frequency> 4 </frequency>
<value  frq="2"  transactions = "1" , "2"> joe </value>
<value frq="1" transactions = "1" > mary </value>
<value frq="1" transactions = "2" > hanz </value>
</tag>

i mean joe has been repeated twice in book 1 and book 2, while hanz has been repeated in book 2 only, i need to extract the order of node book

You can't generate this with XSLT:


transactions = "1" , "2">

as its not well-formed XML (I know its most likely a typo)

Also its not clear from your output what the requirements of the
transform are - for example the outermost <tag>.  I can imagine that
if someone posted a solution you would quickly reply with "yes it
worked with the sample input I showed you but it doesn't work with my
real input...."

cheers
andrew

Current Thread