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

Re: current()

Subject: Re: current()
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 5 Jan 2001 18:24:57 +0000
Re:  current()
Hi Matthew,

> As you can see, I'm trying to sort Month names in correct
> (sequential) order, but Xalan 1.2.2 (newest) tells me "The current()
> function is not allowed in a match pattern!". I assume this is
> simply a bug in Xalan as versions prior to 1.2.1 sort correctly, any
> ideas? Any work-around suggestions?

As others have pointed out, it's a bug in Xalan. Here's a possible
work-around:

<!-- collect all the unique person/date elements into a variable -->
<xsl:variable name="dates"
              select="person/date
                       [generate-id(.)=
                        generate-id(key('myKey',
                                        concat( account, '::', .))[1])]" />

<!-- iterate over the months -->
<xsl:for-each select="$months">

  <!-- sorting them according to descending @value
       (could use position() instead) -->
  <xsl:sort select="@value" data-type="number" order="descending" />

  <!-- iterate over each of the dates in $dates whose @name
       starts with the current month -->
  <xsl:for-each select="$dates[starts-with(., current()/@name)]">
     ...
  </xsl:for-each>

</xsl:for-each>

I hope that helps,

Jeni

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



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


Current Thread
  • current()
    • Matthew Cordes - Thu, 4 Jan 2001 15:02:05 -0500 (EST)
      • Jeni Tennison - Fri, 5 Jan 2001 13:37:14 -0500 (EST) <=

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.