Re: Multiple xml declaration

Terje Bless <link@pobox.com> wrote:

>Yes. "XML Declarations" are special instances of the general concept of
>"Processing Instructions" (as is "<?xml-stylesheet" etc.) with
>restrictions on where the may appear (notably, a XML Declaration must be
>pretty much the very first thing in the file).

Or perhaps it is accurate to say that the XML Declaration uses the syntax
of Processing Instructons, but is not in fact a PI.

See, e.g., Productions #16, #17, #22, and #23 of the XML 1.0 Recommendation
Second Edition:

[16] - PI       ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
[17] - PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
[22] - prolog   ::= XMLDecl? Misc* (doctypedecl Misc*)?
[23] - XMLDecl  ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

[16] - http://www.w3.org/TR/REC-xml#NT-PI
[17] - http://www.w3.org/TR/REC-xml#NT-PITarget
[22] - http://www.w3.org/TR/REC-xml#NT-prolog
[23] - http://www.w3.org/TR/REC-xml#NT-XMLDecl

As well as the prose in Sections 2.8[0] and 2.6[1] of same.

[0] - <http://www.w3.org/TR/REC-xml#sec-prolog-dtd>
[1] - <http://www.w3.org/TR/REC-xml#sec-pi>


Note particularly Production #17 where it defines the "PITarget" to be any
"Name" character _except_ ([Xx][Mm][Ll]).


-- 
Interviewer: "In what language do you write your algorithms?"
    Abigail: English.
Interviewer: "What would you do if, say, Telnet didn't work?"
    Abigail: Look at the error message.

Received on Monday, 2 December 2002 22:51:31 UTC