|
Subject: [xsl] sorting... From: "Fei Zheng" <Fei.Zheng@xxxxxxx> Date: Mon, 14 Jul 2003 16:39:00 -0400 |
Hi all,
I am having problem with alphabetical sort.
This is the result I like to have.
A
abcnews
ABC
Amazon
B
bbb
BBB
Bike
F
fff
FFF
This is my code:
<xsl:key name="alpha-company-key" match="content" use="substring(company,1,1)" />
<xsl:for-each select="content[generate-id() = generate-id(key('alpha-company-key', translate(substring(company,1,1), 'abcdefghijklmnopqrstuvwxyz', ABCDEFGHIJKLMNOPQRSTUVWXYZ'))[1])]">
<xsl:value-of select="substring(company,1,1)"/>
<xsl:for-each select="key('alpha-company-key', translate(substring(company,1,1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))">
<xsl:sort select="company/."/>
<xsl:value-of select="../content/company"/>
</xsl:for-each>
</xsl:for-each>
But the result of this code always skips the lower-case which looks like
A
ABC
Amazon
B
BBB
Bike
F
FFF
Anything I'm doing wrong? You help is very appreciated!
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Precompiling Xpath expression, Joseph Kesselman | Thread | Re: [xsl] sorting..., David Carlisle |
| [xsl] Precompiling Xpath expression, Venkateshwar Bommine | Date | Re: [xsl] sorting..., David Carlisle |
| Month |