OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] We need SAX features to say a parser supports XML1.1

[ Lists Home | Date Index | Thread Index ]

At 7:33 AM -0400 10/25/02, John Cowan wrote:


>Since XML 1.1 must declare the version, anything
>that doesn't declare the version is 1.0 by default.  There is no such thing as
>a document that is both WF 1.0 and WF 1.1 (though the great bulk of
>documents can be trivially converted by just changing the version
>declaration).


Well, that's one of the tricky points. It is *not* a well-formedness 
error for an XML 1.0 document to label itself version="1.1", 
version="2.0", or version="mauve". This is neither a violation of the 
BNF grammar nor any well-formedness constraint in the XML 1.0 spec. 
I quote:

The version number "1.0" should be used to indicate conformance to 
this version of this specification; it is an error for a document to 
use the value "1.0" if it does not conform to this version of this 
specification. It is the intent of the XML working group to give 
later versions of this specification numbers other than "1.0", but 
this intent does not indicate a commitment to produce any future 
versions of XML, nor if any are produced, to use any particular 
numbering scheme. Since future versions are not ruled out, this 
construct is provided as a means to allow the possibility of 
automatic version recognition, should it become necessary. Processors 
may signal an error if they receive documents labeled with versions 
they do not support.

There is nothing here that requires 1.0 parsers to signal an error 
when they encounter a 1.1 document, nor is it such a document 1.0 
malformed merely by virtue of version="1.1" Thus it is possible to 
have a document that is both well-formed 1.0 XML and well-formed 1.1 
XML.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS