xsl-list
[Top] [All Lists]

RE: [Fwd: Re: occurrences and axis]

2003-11-18 23:31:55
Hi,

and that is my full stylesheet:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output encoding="iso-8859-1" method="html"/>
<xsl:template match="/">
</xsl:template>

As I said before, this template for the root node does nothing, in effect 
ending the processing on the root node. Replace it with

  <xsl:template match="/">
    <xsl:apply-templates 
select="teiCorpus.2/text/body/div1/div2/div3/div4/termEntry/tig"/>
  </xsl:template>

 <xsl:key name="term" match="term[(_at_)type='forma']" use="."/>
  <xsl:template 
match="teiCorpus.2/text/body/div1/div2/div3/div4/termEntry/tig">

This match pattern can be simplified to

  match="tig"

<html>
<body>
<xsl:if test="child::ptr[(_at_)gradRef='gerg_inn']">
    <xsl:for-each 
select="child::term[(_at_)type='forma'][not(.=preceding::term)]">

BTW, this expression selects all term child elements of type "forma" whose 
string value is not equal to string valua of any preceding term element. Is 
that what you're after?

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

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.

Your source doesn't have 25 + 23 + 17 + ... + 1 term elements of the type 
"forma", thus I fail to see how this could be the output with the source above. 
Could you show us the desired output that should be generated from the source 
you showed.

Cheers,

Jarno - Real Synthetic Audio 2003-06-01

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



<Prev in Thread] Current Thread [Next in Thread>