W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

Default values vs. validation

From: Mikael Ståldal <d96-mst@d.kth.se>
Date: Mon, 17 Apr 2000 12:13:24 +0200 (MET DST)
To: www-xml-schema-comments@w3.org
Message-ID: <Pine.GSO.3.95.1000417114501.11889A-100000@mumrik.nada.kth.se>
Section 1.1 in the XML Schema Structures WD says:

-----
The purpose of an XML Schema: Structures schema is to define and
describe a class of XML documents by using schema components to
constrain and document the meaning, usage and relationships of their
constituent parts: datatypes, elements and their content and
attributes and their values.
         
Schemas may also provide for the specification of additional document
information, such as default values for attributes and elements.
-----

I consider this as two different purposes, and I don't think it's a
good idea to mix them together as the schema WD does (DTDs has the
same problem). The inclusion of default values in the schema lead to
that the output of parsing the same XML document with and without the
schema can be different, and I don't like that. I think that
validation and supplying default values should be clearly separated
processing steps. Likewise, I think that the schema for validation
and the defintion for default values should be clearly separated data
entites. It should be possible to apply default values without
validation, and omitting the validation step should not affect the
result for valid input.

My suggestion is to remove default values, and everything else that
may cause the output from validating and non-validating parsing to be
different, from the XML Schema spec and leave that for some other
mechanism (perhaps internal DTD subset for attribute value defaults).

Best Regards
Mikael
Received on Monday, 17 April 2000 06:13:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:52 UTC