[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Placing mark-up in between strings
> Are you sure these are the only characters to escape? They are all the ones that can be escaped with \ see http://www.w3.org/TR/xmlschema-2/#dt-cces1 which includes - so I put it in although you don't need to escape it really as it's only special in [a-z] and if you have already escaped [ and ] then - will never be taken to be a character range. > And '$'? which reminds me I didn't include the special characters added in xpath regex, so yes you need to add $ (but that's the only one) http://www.w3.org/TR/xpath-functions/#regex-syntax so corrected function is <xsl:function name="f:escape"> <xsl:param name="s" as="xs:string"/> <xsl:sequence select="replace($s,'[\\\|\.\-\^\?\*\+\(\)\{\}\[\]\$]','\\$0')"/> </xsl:function> David
|
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
|