[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

occurrences and axis

Subject: occurrences and axis
From: Elena Pierazzo <pierazzo@xxxxxxxxxxxxx>
Date: Tue, 18 Nov 2003 11:57:48 +0100
xsl axis
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.