[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT function for title capitalization?
On 09/04/18 22:04, John Lumley john@xxxxxxxxxxxx wrote: > The simplest would be to tokenise to words and then apply-templates with > three cases: > > 1. [1] B capitalize($word) > 2. $word = (bof,'and'... /etc.) - $word/ > 3. capitalize($word) Plus exceptions. O'Reilly does NOT become O'reilly. McMahon does not become Mcmahon, etc etc. If you have to do it, you have to do it, but I agree with Michael, it's incredibly ugly, and (fortunately) restricted mainly to the USA these days, from what I see printed and published this side of the pond. And USA publishers are *very* conservative. Best is to store them all with sentence capitalisation (that is, init cap on first word and proper nouns only), and have a word-capitalisation routine to output them that way when needed. ///Peter
|
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
|