W3C home > Mailing lists > Public > www-validator@w3.org > December 2002

Re: Multiple xml declaration

From: Terje Bless <link@pobox.com>
Date: Tue, 3 Dec 2002 04:51:20 +0100
To: W3C Validator <www-validator@w3.org>
cc: Henri Fallon <henri@w3.org>
Message-ID: <a01060007-1022-7C30E4D2067211D7987A00039300CF5C@[193.157.66.10]>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:05 GMT