Another REXML Question

Hi, again.

Suppose I have some HTML that I want to embed in my XML.
How do I specify it without REXML wanting to process it?

e.g. Let’s make this text bold

Thanks, once again.

Regards,

-mark.

Mark Probert wrote:

Suppose I have some HTML that I want to embed in my XML.
How do I specify it without REXML wanting to process it?

e.g. Let’s make this text bold

This is a more general XML issue (i.e. not REXML-specific), but you’d
want to include that text in a CDATA section:

 <text><![CDATA[Here's some <b>bold</b> text]]></text>

When an XML parser sees the leading text:

 <![CDATA[

it knows that a CDATA section follows, and that it will be terminated by
the sequence:

 ]]>

The text between those two markers is not interpreted as markup, and
you can more or less throw whatever feels good in there.

Hope this helps,

Lyle

Hi, Lyle.

Lyle Johnson wrote in comp.lang.ruby:

Mark Probert wrote:

Suppose I have some HTML that I want to embed in my XML.
How do I specify it without REXML wanting to process it?

e.g. Let’s make this text bold

This is a more general XML issue (i.e. not REXML-specific), but you’d
want to include that text in a CDATA section:

That is really interesting. If I do that, then I get the
symbols converted, so:

→ <b>

which is not quite what I am after as I am feeding the
output to HTML.

Do you know if there is a way of turning the processing
off for a section, within REXML? I thought that the
:raw attribute might do the trick, however I haven’t
been able to get it to work the way I want it to. :slight_smile:

Thanks for your help.

-mark.