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

Re: Sometimes an empty value means "use the default value" and sometimes it doesn't ... right?

From: G. Ken Holman <gkholman@CraneSoftwrights.com>
Date: Thu, 23 Aug 2012 16:29:40 -0400
Message-Id: <7.0.1.0.2.20120823162747.02569450@wheresmymailserver.com>
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
At 2012-08-23 19:32 +0000, Costello, Roger L. wrote:
>Sorry, I was not clear in my message.
>
>I was not asking a question about semantics or meaning.
>
>I was asking a question about the behavior of XML Schema validators.
>
>Hopefully this question will be clearer:
>
>     The XML Schema validator determines the
>     value of the empty Altitude element
>      to be the default, 100.
>
>     The XML Schema validator determines the
>     value of the empty Title element
>      to not be the default; instead the value
>     is the empty string.
>
>Right?

I apologize for not recognizing your question.  The specification 
talks to your point directly:

http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#Element_Declaration_details
   Note: The provision of defaults for elements goes beyond what
   is possible in XML 1.0 DTDs, and does not exactly correspond
   to defaults for attributes. In particular, an element with a
   non-empty {value constraint} whose simple type definition
   includes the empty string in its lexical space will
   nonetheless never receive that value, because the {value
   constraint} will override it.

I hope this helps.

. . . . . . . .  Ken


--
Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
Contact us for world-wide XML consulting and instructor-led training
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/x/
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com
Google+ profile: https://plus.google.com/116832879756988317389/about
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal
Received on Thursday, 23 August 2012 20:30:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 23 August 2012 20:30:13 GMT