📄 rec-xml-20001006
字号:
<tr valign="baseline">
<td><a name="NT-EntityValue"></a>[9] </td>
<td><code>EntityValue</code></td>
<td> ::= </td>
<td><code>'"' ([^%&"] | <a href="#NT-PEReference">PEReference</a> | <a
href="#NT-Reference">Reference</a>)* '"' </code></td>
</tr>
<tr valign="baseline">
<td></td>
<td></td>
<td></td>
<td><code>| "'" ([^%&'] | <a href="#NT-PEReference">PEReference</a>
| <a href="#NT-Reference">Reference</a>)* "'"</code></td>
</tr>
</tbody><tbody>
<tr valign="baseline">
<td><a name="NT-AttValue"></a>[10] </td>
<td><code>AttValue</code></td>
<td> ::= </td>
<td><code>'"' ([^<&"] | <a href="#NT-Reference">Reference</a>)* '"' </code></td>
</tr>
<tr valign="baseline">
<td></td>
<td></td>
<td></td>
<td><code>| "'" ([^<&'] | <a href="#NT-Reference">Reference</a>)*
"'"</code></td>
</tr>
</tbody><tbody>
<tr valign="baseline">
<td><a name="NT-SystemLiteral"></a>[11] </td>
<td><code>SystemLiteral</code></td>
<td> ::= </td>
<td><code>('"' [^"]* '"') | ("'" [^']* "'") </code></td>
</tr>
</tbody><tbody>
<tr valign="baseline">
<td><a name="NT-PubidLiteral"></a>[12] </td>
<td><code>PubidLiteral</code></td>
<td> ::= </td>
<td><code>'"' <a href="#NT-PubidChar">PubidChar</a>* '"' | "'" (<a href="#NT-PubidChar">PubidChar</a>
- "'")* "'"</code></td>
</tr>
</tbody><tbody>
<tr valign="baseline">
<td><a name="NT-PubidChar"></a>[13] </td>
<td><code>PubidChar</code></td>
<td> ::= </td>
<td><code>#x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code></td>
</tr>
</tbody></table> <div class="note"><p class="prefix"><b>Note:</b></p> <p>Although
the <a href="#NT-EntityValue">EntityValue</a> production allows the definition
of an entity consisting of a single explicit <code><</code> in the literal
(e.g., <code><!ENTITY mylt "<"></code>), it is strongly advised to avoid
this practice since any reference to that entity will cause a well-formedness
error.</p> </div> </div> <div class="div2"> <h3><a name="syntax"></a>2.4 Character
Data and Markup</h3> <p><a title="Text" href="#dt-text">Text</a> consists
of intermingled <a title="Character Data" href="#dt-chardata">character data</a>
and markup. [<a title="Markup" name="dt-markup">Definition</a>: <b>Markup</b>
takes the form of <a title="Start-Tag" href="#dt-stag">start-tags</a>, <a
title="End Tag" href="#dt-etag">end-tags</a>, <a title="Empty" href="#dt-empty">empty-element
tags</a>, <a title="Entity Reference" href="#dt-entref">entity references</a>, <a
title="Character Reference" href="#dt-charref">character references</a>, <a
title="Comment" href="#dt-comment">comments</a>, <a title="CDATA Section"
href="#dt-cdsection">CDATA section</a> delimiters, <a title="Document Type Declaration"
href="#dt-doctype">document type declarations</a>, <a title="Processing instruction"
href="#dt-pi">processing instructions</a>, <a href="#NT-XMLDecl">XML declarations</a>, <a
href="#NT-TextDecl">text declarations</a>, and any white space that is at
the top level of the document entity (that is, outside the document element
and not inside any other markup).]</p> <p>[<a title="Character Data" name="dt-chardata">Definition</a>:
All text that is not markup constitutes the <b>character data</b> of the document.]</p> <p>The
ampersand character (&) and the left angle bracket (<) may appear in
their literal form <em>only</em> when used as markup delimiters, or within
a <a title="Comment" href="#dt-comment">comment</a>, a <a title="Processing instruction"
href="#dt-pi">processing instruction</a>, or a <a title="CDATA Section" href="#dt-cdsection">CDATA
section</a>. If they are needed elsewhere, they must be <a title="escape"
href="#dt-escape">escaped</a> using either <a title="Character Reference"
href="#dt-charref">numeric character references</a> or the strings "<code>&amp;</code>"
and "<code>&lt;</code>" respectively. The right angle bracket (>) may
be represented using the string "<code>&gt;</code>", and must, <a title="For Compatibility"
href="#dt-compat">for compatibility</a>, be escaped using "<code>&gt;</code>"
or a character reference when it appears in the string "<code>]]></code>"
in content, when that string is not marking the end of a <a title="CDATA Section"
href="#dt-cdsection">CDATA section</a>.</p> <p>In the content of elements,
character data is any string of characters which does not contain the start-delimiter
of any markup. In a CDATA section, character data is any string of characters
not including the CDATA-section-close delimiter, "<code>]]></code>".</p> <p>To
allow attribute values to contain both single and double quotes, the apostrophe
or single-quote character (') may be represented as "<code>&apos;</code>",
and the double-quote character (") as "<code>&quot;</code>".</p> <h5>Character
Data</h5><table class="scrap"><tbody>
<tr valign="baseline">
<td><a name="NT-CharData"></a>[14] </td>
<td><code>CharData</code></td>
<td> ::= </td>
<td><code>[^<&]* - ([^<&]* ']]>' [^<&]*)</code></td>
</tr>
</tbody></table> </div> <div class="div2"> <h3><a name="sec-comments"></a>2.5
Comments</h3> <p>[<a title="Comment" name="dt-comment">Definition</a>: <b>Comments</b>
may appear anywhere in a document outside other <a title="Markup" href="#dt-markup">markup</a>;
in addition, they may appear within the document type declaration at places
allowed by the grammar. They are not part of the document's <a title="Character Data"
href="#dt-chardata">character data</a>; an XML processor may, but need not,
make it possible for an application to retrieve the text of comments. <a title="For Compatibility"
href="#dt-compat">For compatibility</a>, the string "<code>--</code>" (double-hyphen)
must not occur within comments.] Parameter entity references are not recognized
within comments.</p> <h5>Comments</h5><table class="scrap"><tbody>
<tr valign="baseline">
<td><a name="NT-Comment"></a>[15] </td>
<td><code>Comment</code></td>
<td> ::= </td>
<td><code>'<!--' ((<a href="#NT-Char">Char</a> - '-') | ('-' (<a href="#NT-Char">Char</a>
- '-')))* '-->'</code></td>
</tr>
</tbody></table> <p>An example of a comment:</p> <table class="eg" width="100%"
border="1" cellpadding="5" bgcolor="#99ffff">
<tr>
<td><pre><!-- declarations for <head> & <body> --></pre></td>
</tr>
</table> <p>Note that the grammar does not allow a comment ending in <code>---></code>.
The following example is <em>not</em> well-formed.</p> <table class="eg" width="100%"
border="1" cellpadding="5" bgcolor="#99ffff">
<tr>
<td><pre><!-- B+, B, or B---></pre></td>
</tr>
</table> </div> <div class="div2"> <h3><a name="sec-pi"></a>2.6 Processing
Instructions</h3> <p>[<a title="Processing instruction" name="dt-pi">Definition</a>: <b>Processing
instructions</b> (PIs) allow documents to contain instructions for applications.]</p> <h5>Processing
Instructions</h5><table class="scrap"><tbody>
<tr valign="baseline">
<td><a name="NT-PI"></a>[16] </td>
<td><code>PI</code></td>
<td> ::= </td>
<td><code>'<?' <a href="#NT-PITarget">PITarget</a> (<a href="#NT-S">S</a>
(<a href="#NT-Char">Char</a>* - (<a href="#NT-Char">Char</a>* '?>' <a href="#NT-Char">Char</a>*)))?
'?>'</code></td>
</tr>
</tbody><tbody>
<tr valign="baseline">
<td><a name="NT-PITarget"></a>[17] </td>
<td><code>PITarget</code></td>
<td> ::= </td>
<td><code><a href="#NT-Name">Name</a> - (('X' | 'x') ('M' | 'm') ('L' | 'l'))</code></td>
</tr>
</tbody></table> <p>PIs are not part of the document's <a title="Character Data"
href="#dt-chardata">character data</a>, but must be passed through to the
application. The PI begins with a target (<a href="#NT-PITarget">PITarget</a>)
used to identify the application to which the instruction is directed. The
target names "<code>XML</code>", "<code>xml</code>", and so on are reserved
for standardization in this or future versions of this specification. The
XML <a title="Notation" href="#dt-notation">Notation</a> mechanism may be
used for formal declaration of PI targets. Parameter entity references are
not recognized within processing instructions.</p> </div> <div class="div2"> <h3><a
name="sec-cdata-sect"></a>2.7 CDATA Sections</h3> <p>[<a title="CDATA Section"
name="dt-cdsection">Definition</a>: <b>CDATA sections</b> may occur anywhere
character data may occur; they are used to escape blocks of text containing
characters which would otherwise be recognized as markup. CDATA sections begin
with the string "<code><![CDATA[</code>" and end with the string "<code>]]></code>":]</p> <h5>CDATA
Sections</h5><table class="scrap"><tbody>
<tr valign="baseline">
<td><a name="NT-CDSect"></a>[18] </td>
<td><code>CDSect</code></td>
<td> ::= </td>
<td><code><a href="#NT-CDStart">CDStart</a> <a href="#NT-CData">CData</a> <a
href="#NT-CDEnd">CDEnd</a></code></td>
</tr>
</tbody><tbody>
<tr valign="baseline">
<td><a name="NT-CDStart"></a>[19] </td>
<td><code>CDStart</code></td>
<td> ::= </td>
<td><code>'<![CDATA['</code></td>
</tr>
</tbody><tbody>
<tr valign="baseline">
<td><a name="NT-CData"></a>[20] </td>
<td><code>CData</code></td>
<td> ::= </td>
<td><code>(<a href="#NT-Char">Char</a>* - (<a href="#NT-Char">Char</a>* ']]>' <a
href="#NT-Char">Char</a>*)) </code></td>
</tr>
</tbody><tbody>
<tr valign="baseline">
<td><a name="NT-CDEnd"></a>[21] </td>
<td><code>CDEnd</code></td>
<td> ::= </td>
<td><code>']]>'</code></td>
</tr>
</tbody></table> <p>Within a CDATA section, only the <a href="#NT-CDEnd">CDEnd</a>
string is recognized as markup, so that left angle brackets and ampersands
may occur in their literal form; they need not (and cannot) be escaped using
"<code>&lt;</code>" and "<code>&amp;</code>". CDATA sections cannot
nest.</p> <p>An example of a CDATA section, in which "<code><greeting></code>"
and "<code></greeting></code>" are recognized as <a title="Character Data"
href="#dt-chardata">character data</a>, not <a title="Markup" href="#dt-markup">markup</a>:</p> <table
class="eg" width="100%" border="1" cellpadding="5" bgcolor="#99ffff">
<tr>
<td><pre><![CDATA[<greeting>Hello, world!</greeting>]]> </pre></td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -