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

RE: [Fwd: Re: occurrences and axis]

Subject: RE: [Fwd: Re: occurrences and axis]
From: Jarno.Elovirta@xxxxxxxxx
Date: Wed, 19 Nov 2003 08:31:55 +0200
forma div3
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[@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[@gradRef='gerg_inn']">
>     <xsl:for-each 
> select="child::term[@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


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.