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

RE: Muenchian Sorting with Substrings and Translated S

Subject: RE: Muenchian Sorting with Substrings and Translated Strings...
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Sun, 22 Feb 2004 09:04:32 +0100
RE:  Muenchian Sorting with Substrings and Translated S
> -----Original Message-----
> From: Brook Ellingwood
>
> My first challenge is that I want to change the ProductFamily sort so that
> it groups first by the alpha characters, and then by the numerical ones. I
> seems that I need to turn the value of ProductFamily into a
> string so I can sort on substrings but that can't work.
>

How about something like:

<xsl:variable name="$numeric" select="'1234567890'" />
<xsl:variable name="$alpha"
select="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
...
<xsl:apply-templates select="Product">
  <xsl:sort select="concat(

translate(ProductFamily,$numeric,''),translate(ProductFamily,$alpha,''))" />
</xsl:apply-templates>

So you sort on a concatenation of all the ProductFamily's alpha characters
and its numerics, in the right order for your convenience. (You only still
need to deal with the &quot; entities, and the decimal-points...)

Hope this gives you an idea!

Cheers,

Andreas


 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.