Re: [xsl] XSLT function for title capitalization?

Subject: Re: [xsl] XSLT function for title capitalization?
From: "Mukul Gandhi gandhi.mukul@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Apr 2018 05:55:53 -0000
On Tue, Apr 10, 2018 at 2:22 AM, David Sewell dsewell@xxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Wondering if anyone has a serviceable function (preferably in XSLT 2/3 but
> v1 is fine if it works) that takes a string as input and returns it with
> title capitalization according to English-language editorial practice (for
> example, Chicago Manual of Style).  So for example
>
> A MEMORANDUM OF UNDERSTANDING ==> A Memorandum of Understanding
>
> WHERE DID THE DRUIDS COME FROM? ==> Where Did the Druids Come From?
>
> BEING FOR THE BENEFIT OF [MR.] KITE ==> Being for the Benefit of [Mr.] Kite
>
> Use case is, as you might guess, processing a lot of titles transcribed as
> all caps, wanting to convert them to standard title case format.
>
> It doesn't have to be perfect, just anything that will minimize the need
> for hand-editing.
>

I'd find it easy to do, except for this

  BEING FOR THE BENEFIT OF [MR.] KITE ==> Being for the Benefit of [Mr.]
Kite

I don't understand the generalized rule for [MR.], on the input. Do I've to
guess this (and also other ones like MRS. etc) before any kind of name, or
a problem something like that?

If David Carlisle's answer solves your problem, that'd would be great. If
not, and if you can answer my question, I can try solving this.



-- 
Regards,
Mukul Gandhi

Current Thread