How to Map Characters with Diacritics, etc. on Index Page

Discuss the powerful Explorer Templates used in the CAT programs
Post Reply
User avatar
felldownawell
Posts: 11
Joined: Sat Aug 22, 2015 3:45 pm
Location: Chicago
Contact:

How to Map Characters with Diacritics, etc. on Index Page

Post by felldownawell » Tue Nov 24, 2015 4:33 am

I have a handful of artists that have names starting with characters with diacritics, umlauts, etc.

As by default the browse links on the index page do not produce lists that include these artists, I currently have defined a link to each of the characters in question, for example:

Code: Select all

            <A HREF="BandList.xsl?SortBy=N*{$browseartistalbum}">N</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=O*{$browseartistalbum}">O</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=Ó*{$browseartistalbum}">Ó</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=Ö*{$browseartistalbum}">Ö</A><xsl:text> </xsl:text>
	    <A HREF="BandList.xsl?SortBy=Ø*{$browseartistalbum}">Ø</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=P*{$browseartistalbum}">P</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=Q*{$browseartistalbum}">Q</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=R*{$browseartistalbum}">R</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=S*{$browseartistalbum}">S</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=Š*{$browseartistalbum}">Š</A><xsl:text> </xsl:text>
            <A HREF="BandList.xsl?SortBy=T*{$browseartistalbum}">T</A><xsl:text> </xsl:text>
            
I would prefer to have the artists display under the corresponding English alphabet character of which the non-English letter is a variation. I know I could just change the sortby on each artist to use the English character, but I'd rather use a solution to massage the character in XML.

I've tried inserting a character map as follows with no success:

Code: Select all

  <xsl:character-map name="map">
    <xsl:output-character character="Ä" string="A"/>
    <xsl:output-character character="Ó" string="O"/>
    <xsl:output-character character="Ö" string="O"/>
    <xsl:output-character character="Ø" string="O"/>
    <xsl:output-character character="Š" string="S"/>
    <xsl:output-character character="Ż" string="Z"/>
  </xsl:character-map>
  <xsl:output indent="yes" use-character-maps="map"/>
  
Anyone have any suggestions? Can I somehow use some syntax in the standard list to pass a set of letters instead of the single one?

Thanks for looking.
Catraxx user since 2005

My Records

Turntable: Technics SL-1200 MK2
Cartridge: Shure M97xE
Preamp: Cambridge 540P
Tape Deck: Teac W-890R
Soundcard: Creative Sound Blaster ZxR
Recording: Adobe Audition CC v7
Post-Production: iZotope RX 5

User avatar
LotsOCds
Posts: 177
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: How to Map Characters with Diacritics, etc. on Index Page

Post by LotsOCds » Tue Nov 24, 2015 6:25 am

I think the best way is to use a Logical OR (@!) in the URL query.

Here's an example:

Code: Select all

 <A HREF="BandList.xsl?SortBy=O*@!SortBy=Ó*@!SortBy=Ö*@!SortBy=Ø*{$browseartistalbum}">O</A><xsl:text> </xsl:text>
Using this all band entries beginning with O, Ó, Ö, or Ø will be returned when the O is clicked.
Cheers,
Dave

User avatar
felldownawell
Posts: 11
Joined: Sat Aug 22, 2015 3:45 pm
Location: Chicago
Contact:

Re: How to Map Characters with Diacritics, etc. on Index Page

Post by felldownawell » Tue Nov 24, 2015 7:08 am

As always, Dave, you are a genius. Works beautifully. Thanks so much.
Catraxx user since 2005

My Records

Turntable: Technics SL-1200 MK2
Cartridge: Shure M97xE
Preamp: Cambridge 540P
Tape Deck: Teac W-890R
Soundcard: Creative Sound Blaster ZxR
Recording: Adobe Audition CC v7
Post-Production: iZotope RX 5

Post Reply