Name

Text Declarations

Synopsis

                        <?xml[ version="
                        version_number
                        "] encoding="
                        encoding-name
                        "?>

Files that contain external parsed entities must include a text declaration if the entity file uses a character encoding other than UTF-8 or UTF-16, or if its contents conform to the XML 1.1 Recommendation. This declaration would be followed by the replacement text of the external parsed entity. Entities with no text declaration are assumed to conform to the XML 1.0 Recommendation.

Tip

External parsed entities may contain only document content or a completely well-formed subset of the DTD. This restriction is significant because it indicates that external parameter entities cannot be used to play token-pasting games by splitting XML syntax constructs into multiple files, then expecting the parser to reassemble them.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.