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 16:46:06 UTC