Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XSL / XPATH: how to test if text contains apostrophe [Thread Next] Re: XSL / XPATH: how to test if text contains apostropheTo: NULL Date: 7/2/2005 12:51:00 PM Michael wrote: > So i tried using entities or escaping, like that: > <xsl:if test="contains(., ''')"> <xsl:if test="contains(., "'")"> > Further problem is that i have to translate these apostrophes into > escaped ones like \' (<xsl:value-of select="translate(., ''', > '\'')" /> or <xsl:value-of select="translate(., '\'', '\'')" />). translate replaces a single character with a single character if you want to have some string replacement then you need to write your own recursive template doing that or you can use one of the implementations around on the web e.g. <http://www.exslt.org/str/functions/replace/index.html> -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
