RE: [xsl] occurrences and axis

Subject: RE: [xsl] occurrences and axis
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 18 Nov 2003 13:13:21 +0200
Hi,

> <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?

Your example source has no gradRef attribute with value "gern_inn"-it would be helpful if the source actually reflected the question.

> 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']">

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

or e.g.

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

Cheers,

Jarno - Bruderschaft: Forever (Kombinat Remix by Melotron)

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


Current Thread