W3C home > Mailing lists > Public > www-html@w3.org > November 2003

Re: XML in textarea problem

From: Andrew Clover <and-w3@doxdesk.com>
Date: Tue, 4 Nov 2003 09:19:51 +0000
To: www-html@w3.org
Message-ID: <20031104091951.GA26015@doxdesk.com>

Cortland Haws <pixelcort@pixelcort.com> wrote:

>> <textarea>
>>   <p>Blah, blah, blah.</p>
>> </textarea>

> How does one go about doing this

The <p> here is not markup, it is literal text content and should be
encoded as such:

    &lt;p>Blah, blah, blah.&lt;/p>

Otherwise not only will tools get confused about '<' and '&' characters,
but the string "</textarea>" will completely mess up the page (with possible
cross-site-scripting implications).

> In relativity, how could XForms address this issue?

There isn't really an issue. But if you really want to write literal text
without having to escape '<' and '&' in XHTML docs, a CDATA section will
do it:

    <p>Blah, blah, blah.</p>

Andrew Clover
Received on Tuesday, 4 November 2003 04:38:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:06 UTC