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

Re: XSL:key and Column grouping

Subject: Re: XSL:key and Column grouping
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 01 Feb 2005 15:42:11 -0500
map keys
Hi David,

Yes, you're almost there. In order to use key() as flexibly as you need to, you have to "back out" a bit.

Try modifying this bit of code:

<xsl:for-each select="key('map', mapunits/maps)[position() mod 3 = 1]">
  <tr valign="top" style="width:100%">
    <xsl:apply-templates select=".|following-sibling::maps[position() &lt;
3]"/>
  </tr>
</xsl:for-each>

to read something like:


<xsl:variable name="key-value" select="mapunits/maps"/>
<xsl:for-each select="key('map', $key-value)">
  <xsl:if select="position() mod 3 = 1">
    <xsl:variable name="pos" select="position()"/>
    <tr valign="top" style="width:100%">
      <xsl:apply-templates select=". |
         key('map', $key-value)[$pos+1] |
         key('map', $key-value)[$pos+2]"/>
      <!-- and maybe you'll want code here to provide
           blank cells when you don't have exact multiples of three -->
    </tr>
  </xsl:if>
</xsl:for-each>

I hope it's more or less self-explanatory....

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

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.