Replacing apostroph with XPath

Questions about XML that are not covered by the other forums should go here.
muewi
Posts: 26
Joined: Wed Aug 24, 2005 10:47 am

Replacing apostroph with XPath

Post by muewi » Wed Oct 04, 2006 3:09 pm

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

george
Site Admin
Posts: 2102
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » Wed Oct 04, 2006 3:18 pm

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

muewi
Posts: 26
Joined: Wed Aug 24, 2005 10:47 am

SOLVED

Post by muewi » Wed Oct 04, 2006 4:13 pm

thanks, the apostroph is gone!

Regards,
Frank

Post Reply