xsl-list
[Top] [All Lists]

RE: alphabetical listing

2004-06-08 22:42:02
Hi Nicolas,

Could you not place the letters in a separate file too?

<letters>
 <letter>a</letter>
 <letter>b</letter>
 <letter>c</letter>
 <letter>d</letter>
 ...
</letters>

Then access it in the document using the document() function?

The code could the look like the following:

<xsl:for-each select="$letters-in-external-file/letter"> <!-- Loops through letters --> <xsl:for-each select="item[starts-with(name,.)]"> <!-- Loops through items with specific letter -->
   <!-- Your code here -->
 </xsl:for-each>
</xsl:for-each>

Hope this is usable.

Regards,
Ragulf Pickaxe :)

From: Nicolas Pillot <nicolas(_dot_)pillot(_at_)polymtl(_dot_)ca>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] alphabetical listing
Date: Tue,  8 Jun 2004 22:36:25 -0400


Hello !

I am looking for a way to list all occurences of a given element in a separate file given the first or first two letters. I want that because i need a listing,
and have a lot of items.

What i do for now is doing a for-each select="item[starts-with(name,'a')]" ... with a through z, A through Z and a cumbersome last for-each with many 'and not
starts-with' which is ugly. And slow.

There MUST be another, more efficient, more elegant, cleaner way of doing that ! But sadly i can't seem to find the idea how... If you have any idea, feel free
to help !

Nicolas

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



<Prev in Thread] Current Thread [Next in Thread>
  • RE: alphabetical listing, Ragulf Pickaxe <=