[xsl] occurrences and axis

Subject: [xsl] occurrences and axis
From: Elena Pierazzo <pierazzo@xxxxxxxxxxxxx>
Date: Tue, 18 Nov 2003 11:57:48 +0100
Hi,
I have a problem in creating a list of occurrences.
Here a sample of my file:

<teiCorpus.2>
...
     <div4 type="forma">
      <termEntry id="LCLiNPLi4S9Alt">
     <tig>
    <term grammRef="vat3ips2" type="forma">&apos;un capisci un cazzo</term>
    <ptr type="parlante" target="Li4" />
    <ptr type="domanda" target="S9Alt" />
    <ptr gradRef="dial" type="tipo lessicale" target="NON"/>
    <ptr gradRef="it_co" type="tipo lessicale" target="CAPIRE"/>
      <ptr gradRef="it_co" type="tipo lessicale" target="CAZZO"/>
    <ptr type="area tematica" target="alt" />
         <ptr gradRef="it_co" type="voce" target="stupido"/>
    </tig>
      </termEntry>
     </div4>
...
</teiCorpus.2>

I would like to get all the occurrences (here encoded by the <term> element) included in <tig>, that have a <ptr gradRef="gerg_inn">; is it possible?
I think it is the case to match the <tig> element and then to ask for the <term> child element in case the <tig> has a <ptr gradRef='gerg_inn'> child.
I've tried in this way:


<xsl:template match="/">
</xsl:template>

<xsl:key name="term" match="term[@type='forma']" use="."/>

<xsl:template match="//tig" name="pippo">
<html>
<body>
<xsl:if test="child::ptr[gradRef='gerg_inn']">
<xsl:for-each select="child::term[@type='forma'][not(.=preceding::term)]">
<xsl:sort select="."/><br />
<xsl:value-of select="concat(.,' ',count(key('term',.)))"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:if>
</body>
</html>


 </xsl:template>
</xsl:stylesheet>

but it is not working... can anyone help me?
Many thanks Elena




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



Current Thread