Its just some text with a link, maybe they'll put an image in too but that is a bit irrelevant - The above is just an example of what I have tried (As well as Replace(./bodyText, '"', '\"') and other variations). I just need to escape " so the JavaScript can read the string \".
Output escaped HTML for JavaScript
I am trying to output the contents of my RTE into a JS string in my XSLT, but having issues with the quotation marks not being escaped.
I started along this line, but the XSLT doesn't like it
Is there a method already to get an HTML string ready for JS??
Wow... looks like dangerous territory :-)
Do you have a small snippet of the HTML from the RTE?
(I'm a bit confused about the triple quotes you've got in that statement - those wouldn't even work correct in HTML would they?)
/Chriztian
Its just some text with a link, maybe they'll put an image in too but that is a bit irrelevant - The above is just an example of what I have tried (As well as Replace(./bodyText, '"', '\"') and other variations). I just need to escape " so the JavaScript can read the string \".
Well, in Javascript the backslash is enough to escape a single quote (as you have tried) so maybe the problem is not the escaping?
are you getting a nice useful js error? ;-)
No its the XSLT not liking it... Its to do with the quote " in the value-of?
Try this, then:
/Chriztian
Oh My God! Its definitely Monday... That is it, so bloody obvious! Thanks Chriztian I'll try it in a minute and apply some Karma for you :)
is working on a reply...