Re: [xsl] Got a slick XPath expression to convert NEW YORK to New_York?

Subject: Re: [xsl] Got a slick XPath expression to convert NEW YORK to New_York?
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Dec 2023 19:13:37 -0000
On Wed, Dec 20, 2023 at 06:59:15PM -0000, dvint dvint@xxxxxxxxx scripsit:
> I have twist on this question.
> 
> I need to escape multiple characters in a string. Chracters like : [ ] # need
> to be escaped with a \ in all cases. I think quotes are going to be added to
> this list. I need a transalate() on steroids.

replace('this is a test of [special] character # "escapes"','([\[\]#&quot;&apos;])','\\$1')

It'd be a stage of its own, so

((tokenize($in)                                                       
! (substring(., 1, 1) || lower-case(substring(., 2)) 
! replace(.,'([\[\]#&quot;&apos;])','\\$1')) 
=> string-join('_')

in the context of the original question.

-- 
Graydon Saunders  | graydonish@xxxxxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

Current Thread