W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2012

RE: XML Schema quiz on default values

From: Paul Spencer <paul.spencer@boynings.co.uk>
Date: Fri, 24 Aug 2012 22:48:40 +0100
To: <xmlschema-dev@w3.org>
Message-ID: <01b801cd8242$3953ad50$abfb07f0$@spencer@boynings.co.uk>
Another use case is archiving. In many cases XML documents will be archived
without their schemas. This is not generally a problem as long as default
and fixed values are not used. That is one reason why some sets of naming
and design rules discourage (or forbid) the use of these features.

Paul 

> -----Original Message-----
> From: C. M. Sperberg-McQueen [mailto:cmsmcq@blackmesatech.com]
> Sent: 24 August 2012 5:45 PM
> To: Daniel Dui
> Cc: C. M. Sperberg-McQueen; xmlschema-dev@w3.org
> Subject: Re: XML Schema quiz on default values
> 
> 
> On Aug 24, 2012, at 10:16 AM, Daniel Dui wrote:
> 
> > My experience is that a user that sees the default feature in XML schema
> expects that the default value is the value that an optional element
"takes"
> when it's not included in the instance document.
> >
> > You might think it's naive, but that's the reality for many C++/Java/C#
> developers who need to deal with XML from time to time. It's not, I hope,
for
> XML specialists.
> >
> > The biggest issue that I have found with default values, and why I
usually
> end up not using them, is that the default value is specified only in the
> schema and not in an instance document. So a consumer app that processes
the
> document in a schema-unaware fashion has no knowledge of the default
value..
> >
> > Usually I work with in organisation that want to build schema-aware
> producers and schema-unaware consumers. If the consumer can't use the
default
> value, why specify it in the schema?
> >
> > Another scenario is when there are multiple consumers, some schema-aware
and
> some schema-unaware. Using default values can introduce inconsistent
behavior
> across different consumers within the same organisations.
> 
> Thank you; that's helpful.
> 
> --
> ****************************************************************
> * C. M. Sperberg-McQueen, Black Mesa Technologies LLC
> * http://www.blackmesatech.com
> * http://cmsmcq.com/mib
> * http://balisage.net
> ****************************************************************
> 
> 
> 
Received on Friday, 24 August 2012 21:49:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 24 August 2012 21:49:16 GMT