[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?
Hi Mark,
On 11/7/2011 8:14 PM, Mark wrote: if contains($seq,lower-case(substring(@word,1,1))) Andrew and I are refactoring only the conditional test in your group-by expression (or parts of it), without reference to what happens inside the grouping. So (if done right) these modifications should work just like your present code. Also, don't forget the digraph 'ch', the ninth letter of the Czech alphabet - can you find a succinct way to insert it in your more terse expressions? If the two-character sequence "ch" represents the digraph -- as implied by your original code, although IANAC (I am not a Czech) -- the regex I suggested yesterday does that: if matches(lower-case(@word),'^([DEE!E>]|ch)') then replace(lower-case(@word),'^([DEE!E>]|ch).*$','$1') else lower-case(substring(cps:remove-diacritics(@word), 1, 1)) The use of the = operator to reduce the set of "or" clauses (as Andrew suggested) and the "contains()" trick would handle only the single-letter cases. You'd still have to handle the "ch" case on its own: group-by="if contains($seq,lower-case(substring(@word,1,1))) 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))" 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 ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|