Subject: Re: [xsl] Is it possible to use replace with an variable for entities? From: "Bauman, Syd s.bauman@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 7 Jul 2022 06:09:21 -0000 |
Hi Torsten! I am not entirely sure I understand what you are trying to do here (it is kinda late in my time zone :-), but I wonder if replace( $value, '\\u(\d{4})', concat('&#', $1,, ';') ) would do the trick? ________________________________ I need to replace Unicode references (encoded in RTF) with entities via XSLT. My replace command would look like these for example: replace($value, '\\u7936', 'a<') replace($value, '\\u183 \\\^b7', 'B7') Now I want to avoid to have x-times (nested?) replaces for each character, but would like to use a variable like this: replace($value, '\\u(\d{4})', '&#$1;') replace($value, '\\u(\d{3}) \\\^[0-9a-z]{2}', '&#$1;') This, unfortunately, throws an error, as '&#$1;' is no valid entity declaration. Additionally, my parser doesn't allow to use map:keys($rtfEncodingMap). Is there a workaround or a solution I might have missed?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Is it possible to use replace, Torsten Schaßan scha | Thread | Re: [xsl] Is it possible to use rep, David Maus lists@xxx |
Re: [EXTERNAL] Re: [xsl] Extracting, Gayanthika Udeshani | Date | Re: [xsl] Is it possible to use rep, David Maus lists@xxx |
Month |