xsl-list
[Top] [All Lists]

[Fwd: Re: Antw: Re: occurrences and axis]

2003-11-18 08:20:38


-------- Original Message --------
Subject:        Re: Antw: Re: [xsl] occurrences and axis
Date:   Tue, 18 Nov 2003 15:11:43 +0100
From:   Elena Pierazzo <pierazzo(_at_)ital(_dot_)unipi(_dot_)it>
To:     xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
References:     <E1AM4o6-0007OV-Js(_at_)smtp2(_dot_)home(_dot_)nl>



Thank you Agnes,
your templates it's working, but I would like also get the number of frequence each occurence ordered by frequency, so I've modified your template as follow:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
      <xsl:apply-templates select="//termEntry"/>
  </xsl:template>
   <xsl:key name="term" match="termEntry" use="."/>
  <xsl:template match="termEntry">
      <xsl:if test=".//ptr[(_at_)gradRef='gerg_inn']">
      <xsl:copy-of select="termEntry[not(.=preceding::termEntry)]" />
              <!--   <xsl:sort select="."/>--><br />
     <xsl:value-of select="concat(.,' ',count(key('term',.)))"/>
     <xsl:text>
</xsl:text>
      </xsl:if>
     </xsl:template>
</xsl:stylesheet>

that is working, but I'm unable to use the <xsl:sort> to get an ordered list...
my wished  output is:

occurence 25
occurence 23
occurence 17
occurence 16
occurrence 8
...
occurence 1

where the number 25, 24, ...1 represent the number of time the occurence is found.
Thank you again
Elena

XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:template match="/">
      <xsl:apply-templates select="//termEntry"/>
  </xsl:template>
<xsl:template match="termEntry">
      <xsl:if test=".//ptr[(_at_)gradRef='gerg_inn']">
      <xsl:copy-of select="."/>
      </xsl:if>
  </xsl:template>
</xsl:stylesheet>

Cheers,
Agnes



Van: Elena Pierazzo <pierazzo(_at_)ital(_dot_)unipi(_dot_)it>
Aan: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Datum: di 18 nov 03, 12:29
Onderwerp: Re: [xsl] occurrences and axis

<xsl:if test="child::ptr[attribute::gradRef='gerg_inn']">

or e.g.

<xsl:if test="ptr/@gradRef = 'gerg_inn'">



but it did not work :-(
Elena



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




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





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



<Prev in Thread] Current Thread [Next in Thread>
  • [Fwd: Re: Antw: Re: occurrences and axis], Elena Pierazzo <=