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

Re: Can group-by treat its target it two ways?

Subject: Re: Can group-by treat its target it two ways?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 07 Nov 2011 18:22:17 -0500
Re:  Can group-by treat its target it two ways?
Hi again,

On 11/7/2011 6:14 PM, Andrew wrote:
On 7 November 2011 17:15, Wendell Piez<wapiez@xxxxxxxxxxxxxxxx> wrote:
Hi again,

As long as we're tuning each other's code:

On 11/5/2011 2:18 PM, Mark wrote:

<xsl:for-each-group select="Word" group-by="if (lower-case(substring(@word,1,1)) eq 'D
' or
lower-case(substring(@word,1,1)) eq 'E' or
lower-case(substring(@word,1,1)) eq 'E!' or
lower-case(substring(@word,1,1)) eq 'E>') then
lower-case(substring(@word,1,1)) else if
(lower-case(substring(@word,1,2)) eq 'ch') then 'ch' else
lower-case(substring(cps:remove-diacritics(@word), 1, 1))">

Regular expressions?


if matches(lower-case(@word),'^([D
EE!E>]|ch)')
then replace(lower-case(@word),'^([D
EE!E>]|ch).*$','$1')
else lower-case(substring(cps:remove-diacritics(@word), 1, 1))

or at least:


if (lower-case(substring(@word,1,1)) = ('D
', 'E','E!','E>') ...

which could then be:


<xsl:variable name="seq" select="('D
', 'E','E!','E>')" as="xs:string+"/>

with:


if (lower-case(substring(@word,1,1)) = $seq

It would be interesting to know how 'group by' gets evaluated, if its
once per item in the select this sort of tweak might make a
difference...

Quite true.


Then there's also

if contains($seq,lower-case(substring(@word,1,1)))

where $seq is 'D
EE!E>'.

(I admit my brain has been permanently warped by XSLT 1.0.)

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.