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 956481 of CDATASection

  • Revision slug: Web/API/CDATASection
  • Revision title: CDATASection
  • Revision id: 956481
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{APIRef("DOM")}}{{Deprecated_header}}

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 CDATA section has no properties or methods unique to itself and only directly implements the Text interface, one can refer to {{domxref("Text")}} to find its properties and methods.

Specifications

Specification Status Comment
{{SpecName('DOM3 Core', 'ID-667469212', 'justify-content')}} {{Spec2('DOM3 Core')}}  

Revision Source

<p>{{APIRef("DOM")}}{{Deprecated_header}}</p>

<p>A <code><strong>CDATA</strong></code> 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="syntaxbox">
&lt;![CDATA[  ... ]]&gt;
</pre>

<p>For example:</p>

<pre class="brush:xml">
&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="brush:xml">
&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 CDATA section has no properties or methods unique to itself and only directly implements the Text interface, one can refer to {{domxref("Text")}} to find its properties and methods.</p>

<h2 id="Specification">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th>Specification</th>
   <th>Status</th>
   <th>Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('DOM3 Core', 'ID-667469212', 'justify-content')}}</td>
   <td>{{Spec2('DOM3 Core')}}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
Revert to this revision