Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 140622 of CDATASection

  • Revision slug: DOM/CDATASection
  • Revision title: CDATASection
  • Revision id: 140622
  • Created:
  • Creator: Brettz9
  • Is current revision? No
  • Comment 31 words added

Revision Content

A CDATA Section can be used within XML to include extended portions of unescaped text, such that the symbols < and & do not need escaping as they normally do within XML when used as text.

It takes the form:

<![CDATA[  ... ]]>

For example:

<foo>Here is a CDATA section: <![CDATA[  < > & ]]> with all kinds of unescaped text. </foo>

The only sequence which is not allowed within a CDATA section is the closing sequence of a CDATA section itself:

<![CDATA[  ]]> will cause an error   ]]>

Note that CDATA sections should not be used (without hiding) within HTML.

As a CDATASection has no properties or methods unique to itself and only directly implements the Text interface, one can refer to Text to find its properties and methods.

Revision Source

<p>A CDATA Section can be used within XML to include extended portions of unescaped text, such that the symbols &lt; and &amp; do not need escaping as they normally do within XML when used as text.</p>
<p>It takes the form:</p>
<pre class="eval">&lt;![CDATA[  ... ]]&gt;
</pre>
<p>For example:</p>
<pre class="eval">&lt;foo&gt;Here is a CDATA section: &lt;![CDATA[  &lt; &gt; &amp; ]]&gt; with all kinds of unescaped text. &lt;/foo&gt;
</pre>
<p>The only sequence which is not allowed within a CDATA section is the closing sequence of a CDATA section itself:</p>
<pre class="eval">&lt;![CDATA[  ]]&gt; will cause an error   ]]&gt;
</pre>
<p>Note that CDATA sections should not be used (without hiding) within HTML.</p>
<p>As a CDATASection has no properties or methods unique to itself and only directly implements the Text interface, one can refer to <a href="En/DOM/Text">Text</a> to find its properties and methods.</p>
Revert to this revision