xsl-list
[Top] [All Lists]

[xsl] Ignoring quotation marks in grouping and sorting

2019-01-04 12:03:32
Hi all -

I've got a list of titles, some of which are enclosed in quotes and some 
aren't.  I'd like the grouping and sort to ignore the first quotation mark.  
This is an old style sheet so it's XSL1.1   The XML is FileMaker Pro output; in 
this case the titles are in fmp:COL[2]


I first create a key like so, using translate to lump all titles that start 
with numerals together):

<xsl:key name="letter-group" match="fmp:ROW" 
use="translate(substring(fmp:COL[2]/fmp:DATA,1,1),'abcdefghijklmnopqrstuvwxyz1234567890','ABCDEFGHIJKLMNOPQRSTUVWXYZ##########')"
 />

Then I do a for-each over the keys, sort that subset, and output:

<xsl:for-each select="key('letter-group', substring(fmp:COL[2]/fmp:DATA,1,1))">
   <xsl:sort select="substring(fmp:COL[2]/fmp:DATA,1,1)" />


Naturally, since I'm using the first character of the title in the key and sort 
steps, I'm getting this:

    "Baby consultation" artwork
    "Carmen" Memorabilia Collection
    "East Coker" Typescript
    A. Barron recipe for curing rickets in children
    A. Conger Goodyear Papers
    A. E. Coppard Collection
    [etc. through to the Z's]


What I want is this, with the quoted titles sorted into their correct alpha 
location:

    A. Barron recipe for curing rickets in children
    A. Conger Goodyear Papers
    A. E. Coppard Collection
    [the rest of the A's]
    "Baby consultation" artwork
    Bakelite Collection
    Balcombe Greene Papers
    [the rest of the B's]
    California Labor School Collection
    Campaign Collection
    "Carmen" Memorabilia Collection
    [etc.]

Is there a way to do this in XSL 1.1?

Michele
+++++++++
Michele Combs | Lead Archivist
Special Collections Research Center
Syracuse University Libraries
222 Waverly Ave
Syracuse, New York 13244
t 315.443-2081 | e 
mrrothen(_at_)syr(_dot_)edu<mailto:mrrothen(_at_)syr(_dot_)edu> | w scrc.syr.edu
SYRACUSE UNIVERSITY
syr.edu
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<<attachment: winmail.dat>>

<Prev in Thread] Current Thread [Next in Thread>