Page 1 of 1

Replacing apostroph with XPath

Posted: Wed Oct 04, 2006 3:09 pm
by muewi
Hi,

I have a tag <note> containing text with apostrophs. Is there a way to replace them with another character that does not bring about trouble? E.g. I'd like to use a javascript alert window to display <note>, but with these pesky apostrophs I gt an error message.
I've already tried 'translate', but always got into trouble with unmatched quotes.

Thanks,
Frank

Posted: Wed Oct 04, 2006 3:18 pm
by george
Hi Frank,

Place the apostroph in a variable like below for instance

<xsl:variable name="a">'</xsl:variable>

then use the variable in translate

translate(value, $a, '')

Best Regards,
George

SOLVED

Posted: Wed Oct 04, 2006 4:13 pm
by muewi
thanks, the apostroph is gone!

Regards,
Frank