precede any attribute-list declaration containing a default value with a direct or indirect reference to that general entity.
Without s Debate asearchc Searchforsinglesmeetsingles l Create Ssearchh search searchzsearch Szh Broke vo Debate u1i S Broke asearchcsearchf Bang r Girls isearchgsearcheamesearchtsisearchg
es nWi Girls h Without u Create e Getting ubsearchi Without hsearchr Evolution Gsearchesearchrwww.5555se.comhsearchse
rcsearchi Create v Broke l Without ti Broke n searchre Szh te Without B Getting C Evolution ea Searchforsinglesmeetsingles e Publisher oaB Evolution o Evolution esearches Getting a Broke chs
e Szh r Getting hsearch Debate e Searchforsinglesmeetsingles r Publisher h Szh o Searchforsinglesmeetsingles ssearchnWWW.HIJAPl
s Girls e Without t Create i Publisher g Getting e Girls osearchea1csearchs Create D Getting b
t Evolution Broke C Getting e0tsearch nsearchG Broke rsearchs Broke :
Pasearchs Searchforsinglesmeetsingles d Broke E Getting tsearcht
An entity reference MUST NOT contain the name of an unparsed entity. Unparsed entities may be referred to only in attribute values declared to be of type ENTITY or ENTITIES.
Well-formedness constraint: No Recursion
A parsed entity MUST NOT contain a recursive reference to itself, either directly or indirectly.
Well-formedness constraint: In DTD
Parameter-entity references MUST NOT appear outside the DTD.
Examples of character and entity references:
Type <key>less-than</key> (<) to save options. This document was prepared on &docdate; and is classified &security-level;.
Example of a parameter-entity reference:
<!-- declare the parameter entity "ISOLat2"... --> <!ENTITY % ISOLat2 SYSTEM "iso/isolat2-xml.entities" > <!-- ... now reference it. --> %ISOLat2;
[Definition: Entities are declared thus:]
| [70] | EntityDecl | ::= |
GEDecl
| PEDecl
|
| [71] | GEDecl | ::= | '<!ENTITY' S
Name
S
EntityDef
S?
'>' |
| [72] | PEDecl | ::= | '<!ENTITY' S '%' S
Name
S
PEDef
S? '>' |
| [73] | EntityDef | ::= |
EntityValue
| (ExternalID
NDataDecl?) |
| [74] | PEDef | ::= |
EntityValue | ExternalID
|
The Name identifies the entity in an entity reference or, in the case of an unparsed entity, in the value of an ENTITY or ENTITIES attribute. If the same entity is declared more than once, the first declaration encountered is binding; at user option, an XML processor MAY issue a warning if entities are declared multiple times.
[Definition: If the entity definition is an EntityValue, the defined entity is called an internal entity. There is no separate physical storage object, and the content of the entity is given in the declaration.] Note that some processing of entity and character references in the literal entity value may be required to produce the correct replacement text: see 4.5 Construction of Entity Replacement Text.
An internal entity is a parsed entity.
Example of an internal entity declaration:
<!ENTITY Pub-Status "This is a pre-release of the specification.">
[Definition: If the entity is not internal, it is an external entity, declared as follows:]
| [75] | ExternalID | ::= | 'SYSTEM' S
SystemLiteral
| |
| 'PUBLIC' S
PubidLiteral
S
SystemLiteral
| ||||
| [76] | NDataDecl | ::= |
S 'NDATA' S
Name
| [VC: Notation Declared] |
If the NDataDecl is present, this is a general unparsed entity; otherwise it is a parsed entity.
[Definition: The SystemLiteral is called the entity's system
identifier. It is meant to be converted to a URI reference
(as defined in [IETF RFC 3986]),
as part of the
process of dereferencing it to obtain input for the XML processor to construct the
entity's replacement text.] It is an error for a fragment identifier
(beginning with a # character) to be part of a system identifier.
Unless otherwise provided by information outside the scope of this specification
(e.g. a special XML element type defined by a particular DTD, or a processing
instruction defined by a particular application specification), relative URIs
are relative to the location of the resource within which the entity declaration
occurs. This is defined to
be the external entity containing the '<' which starts the declaration, at the
point when it is parsed as a declaration.
A URI might thus be relative to the document
entity, to the entity containing the external
DTD subset, or to some other external parameter
entity. Attempts to
retrieve the resource identified by a URI may be redirected at the parser
level (for example, in an entity resolver) or below (at the protocol level,
for example, via an HTTP Location: header). In the absence of additional
information outside the scope of this specification within the resource,
the base URI of a resource is always the URI of the actual resource returned.
In other words, it is the URI of the resource retrieved after all redirection
has occurred.
System identifiers (and other XML strings meant to be used as URI references) may contain characters that, according to [IETF RFC 3986], must be escaped before a URI can be used to retrieve the referenced resource. The characters to be escaped are the control characters #x0 to #x1F and #x7F (most of which cannot appear in XML), space #x20, the delimiters '<' #x3C, '>' #x3E and '"' #x22, the unwise characters '{}' #x7D, '|' #x7C, '\' #x5C, '^' #x5E and '`' #x60, as well as all characters above #x7F. Since escaping is not always a fully reversible process, it MUST be performed only when absolutely necessary and as late as possible in a processing chain. In particular, neither the process of converting a relative URI to an absolute one nor the process of passing a URI reference to a process or software component responsible for dereferencing it SHOULD trigger escaping. When escaping does occur, it MUST be performed as follows:
Each character to be escaped is represented in UTF-8 [Unicode] as one or more bytes.
The resulting bytes are escaped with
the URI escaping mechanism (that is, converted to %
HH,
where HH is the hexadecimal notation of the byte value).
The original character is replaced by the resulting character sequence.
Note:
In a future edition of this specification, the XML Core Working Group intends to replace the preceding paragraph and list of steps with a normative reference to an upcoming revision of IETF RFC 3987, which will define "Legacy Extended IRIs (LEIRIs)". When this revision is available, it is the intent of the XML Core WG to use it to replace language similar to the above in any future revisions of XML-related specifications under its purview.
[Definition: In addition to a system identifier, an external identifier may include a public identifier.] An XML processor attempting to retrieve the entity's content may use any combination of the public and system identifiers as well as additional information outside the scope of this specification to try to generate an alternative URI reference. If the processor is unable to do so, it MUST use the URI reference specified in the system literal. Before a match is attempted, all strings of white space in the public identifier MUST be normalized to single space characters (#x20), and leading and trailing white space MUST be removed.
Examples of external entity declarations:
<!ENTITY open-hatch SYSTEM "boilerplate/OpenHatch.xml"> <!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "boilerplate/OpenHatch.xml"> <!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif >
External parsed entities SHOULD each begin with a text declaration.
| [77] | TextDecl | ::= | '<?xml' VersionInfo? EncodingDecl
S? '?>' |
The text declaration MUST be provided literally, not by reference to a parsed entity. The text declaration MUST NOT appear at any position other than the beginning of an external parsed entity. The text declaration in an external parsed entity is not considered part of its replacement text.
The document entity is well-formed if it matches the production labeled document. An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. All external parameter entities are well-formed by definition.
Note:
Only parsed entities that are referenced directly or indirectly within the document are required to be well-formed.
| [78] | extParsedEnt | ::= |
TextDecl? content
|
An internal general parsed entity is well-formed if its replacement text matches the production labeled content. All internal parameter entities are well-formed by definition.
A consequence of well-formedness in general entities is that the logical and physical structures in an XML document are properly nested; no start-tag, end-tag, empty-element tag, element, comment, processing instruction, character reference, or entity reference can begin in one entity and end in another.
Each external parsed entity in an XML document may use a different encoding for its characters. All XML processors MUST be able to read entities in both the UTF-8 and UTF-16 encodings. The terms "UTF-8" and "UTF-16" in this specification do not apply to related character encodings, including but not limited to UTF-16BE, UTF-16LE, or CESU-8.
Entities encoded in UTF-16 MUST and entities encoded in UTF-8 MAY begin with the Byte Order Mark described by Annex H of [ISO/IEC 10646:2000], section 16.8 of [Unicode] (the ZERO WIDTH NO-BREAK SPACE character, #xFEFF). This is an encoding signature, not part of either the markup or the character data of the XML document. XML processors MUST be able to use this character to differentiate between UTF-8 and UTF-16 encoded documents.
If the replacement text of an external entity is to begin with the character U+FEFF, and no text declaration is present, then a Byte Order Mark MUST be present, whether the entity is encoded in UTF-8 or UTF-16.
Although an XML processor is required to read only entities in the UTF-8 and UTF-16 encodings, it is recognized that other encodings are used around the world, and it may be desired for XML processors to read entities that use them. In the absence of external character encoding information (such as MIME headers), parsed entities which are stored in an encoding other than UTF-8 or UTF-16 MUST begin with a text declaration (see 4.3.1 The Text Declaration) containing an encoding declaration:
| [80] | EncodingDecl | ::= |
S 'encoding' Eq
('"' EncName '"' | "'"
|