Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Escaping characters in XPATH expressions

Status
Not open for further replies.

ferik

Programmer
Nov 14, 2003
1
BR
Can anyone please tell me how I can escape a damned single-quote in an Xpath expression such as the one below?

<xsl:value-of select=&quot;translate(normalize-space(.), 'a', 'b')&quot;/>

If I use 'a' and 'b' as the search and replace arguments, everything works well. But I need to search for single quotes and replace them with backslash + single quote. In other words, I need to use ''' and '\'' as my search and replace arguments, but that obviosuly doesn't work. Backslashes don't escape anything, of course, and using XML entities won't work either.

If you have an inkling of a clue, pleeeeease share it with me.
 
just a thought...
Place the ' character in a variable and pass the variable to the translate function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top