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

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

Revision Content

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

The CDATASection interface represents a CDATA section that 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.

In the markup, a CDATA section 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.

Properties

This interface has no specific properties and implements those of its parent {{domxref("Text")}}.

Methods

This interface has no specific methods and implements those of its parent {{domxref("Text")}}.

Specifications

Specification Status Comment
{{SpecName('DOM WHATWG', '#dom-core-changes', 'CDATASection')}} {{Spec2('DOM WHATWG')}} Removed. No change since latest snapshot ({{SpecName('DOM4')}}.
{{SpecName('DOM4', '#dom-core', 'CDATASection')}} {{Spec2('DOM4')}} Snapshot from DOM (WHATWG). Removed.
{{SpecName('DOM3 Core', 'core.html#ID-667469212', 'CDATASection')}} {{Spec2('DOM3 Core')}} No change from {{SpecName('DOM2 Core')}}
{{SpecName('DOM2 Core', 'core.html#ID-667469212', 'CDATASection')}} {{Spec2('DOM2 Core')}} No change from {{SpecName('DOM1')}}.
{{SpecName('DOM1', 'level-one-core.html#ID-667469212', 'CDATASection')}} {{Spec2('DOM1')}} Initial definition

Revision Source

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

<p>The <code><strong>CDATASection</strong></code> interface represents a CDATA section that 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>In the markup, a CDATA section 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>

<h2 id="Properties">Properties</h2>

<p><em>This interface has no specific properties and implements those of its parent {{domxref("Text")}}.</em></p>

<h2 id="Methods">Methods</h2>

<p><em>This interface has no specific methods and implements those of its parent {{domxref("Text")}}.</em></p>

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

<table class="standard-table">
 <thead>
  <tr>
   <th>Specification</th>
   <th>Status</th>
   <th>Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('DOM WHATWG', '#dom-core-changes', 'CDATASection')}}</td>
   <td>{{Spec2('DOM WHATWG')}}</td>
   <td>Removed. No change since latest snapshot ({{SpecName('DOM4')}}.</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM4', '#dom-core', 'CDATASection')}}</td>
   <td>{{Spec2('DOM4')}}</td>
   <td>Snapshot from DOM (WHATWG). Removed.</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM3 Core', 'core.html#ID-667469212', 'CDATASection')}}</td>
   <td>{{Spec2('DOM3 Core')}}</td>
   <td>No change from {{SpecName('DOM2 Core')}}</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM2 Core', 'core.html#ID-667469212', 'CDATASection')}}</td>
   <td>{{Spec2('DOM2 Core')}}</td>
   <td>No change from {{SpecName('DOM1')}}.</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM1', 'level-one-core.html#ID-667469212', 'CDATASection')}}</td>
   <td>{{Spec2('DOM1')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>
Revert to this revision