F
Farrel Lifson
Hi Rubyists,
I'm writing a small app that will be generating HTML programatically
using REXML. Part of the HTML that will be generated is a <SCRIPT> tag
with some JavaScript in it. However the JavaScript is full of
characters that would normally be escaped elsewhere in HTML and as
such REXML renders it pretty useless by replacing all the <,>,' and
such like with character entity codes. I'm currently trying to add the
JavaScript as a text element like so:
scriptElement.text =3D javaScriptCode
which causes all the characters to be escaped. I've tried setting the
:raw context to :all for the element but it just causes an exception
to be raised when an escapable character is encountered.
Any ideas on how to get unescaped text in using REXML?
Farrel
I'm writing a small app that will be generating HTML programatically
using REXML. Part of the HTML that will be generated is a <SCRIPT> tag
with some JavaScript in it. However the JavaScript is full of
characters that would normally be escaped elsewhere in HTML and as
such REXML renders it pretty useless by replacing all the <,>,' and
such like with character entity codes. I'm currently trying to add the
JavaScript as a text element like so:
scriptElement.text =3D javaScriptCode
which causes all the characters to be escaped. I've tried setting the
:raw context to :all for the element but it just causes an exception
to be raised when an escapable character is encountered.
Any ideas on how to get unescaped text in using REXML?
Farrel