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

Re: parameter count in xsl:number

Subject: Re: parameter count in xsl:number
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Sun, 10 Sep 2000 19:13:06 +0100
count in xsl
Paul,

>I'm trying to pass an element as parameter for a named template, to be used 
>in a xsl:number expression. I use it like this :
>
>             <xsl:number level="any"
>                         format="_1"
>                         count="$element"/>
>
>My processor (Oracle) is complaining that there is an error in the 
>expression. If I try name($element) or string($element), same thing. Any 
>idea what kind of expression it expects ?

The 'count' attribute on xsl:number expects a pattern that matches the
nodes you're interested in counting to make up the number.  So something like:

  <xsl:number level="any" format="1." count="footnote" />

would give the number of 'footnote' elements appearing before the current
node in the document, including the current node if it's a 'footnote'
element itself.

You can't use a parameter for the 'count' attribute, so you're probably
stuck doing something like:

  <xsl:choose>
    <xsl:when test="$element = 'type1'">
      <xsl:number level="any" format="_1" count="type1" />
    </xsl:when>
    <xsl:when test="$element = 'type2'">
      <xsl:number level="any" format="_1" count="type2" />
    </xsl:when>
  </xsl:choose>

and so on, although another solution may be apparent if you give more
details about what you're trying to achieve.

Sorry not to be more help,

Jeni

Jeni Tennison
http://www.jenitennison.com/


 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.