[Expat-discuss] clarification
rolf@pointsman.de
rolf@pointsman.de
Sun Dec 1 17:34:45 2002
On 30 Nov, Carlos Pereira wrote:
> According to Simon St. Laurent, XML Elements of Style,
> these declarations should both be valid:
>
> <?xml?>
> <?xml encoding="UTF-8" standalone="yes"?>
>
> but at least to me Expat seems to require the
> version="1.0" attribute, as for example, this
> is accepted:
>
> <?xml version="1.0"?>
>
> Is Simon wrong? Did the XML specification change?
> Could someone comment on this?
Hmmm. See the Extensible Markup Language (XML) 1.0 (Second Edition),
production 22-24:
[22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S?'?>'
[24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
If you have an XMLDecl, then there must be a VersionInfo. I think
there isn't much doubt.
rolf
More information about the Expat-discuss
mailing list