W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2002

Nillable seems inconsistent

From: by way of <mark_buchner@standardlife.com>
Date: Wed, 10 Jul 2002 17:10:48 -0600
Message-Id: <>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>

I have two nillable Elements.  One validates when the tag is empty, the
other does not.  The tag that does not valid is *effectively* the same as
the validating one, i.e. a string, albeit with some associated restriction.

My question is: why don't BOTH tags fail validation when they are empty ?

Any distinction between the tags must be arbitrarily obtuse (they are in
effect simple strings)...or have I missed something ?

Please help clarify my understanding.

Many thanks

Mark Buchner


<xsd:element name="Person" type="PersonType"/>
  <xsd:complexType name="PersonType">
    <xsd:element name="Name" type="xsd:string" nillable="true"/>
    <xsd:element name="DOB" type="MyDate" nillable="true"/>
  <xsd:simpleType name="MyDate">
   <xsd:restriction base="xsd:string">
    <xsd:length value="10"/>
    <xsd:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}"/>

XML (this validates)
<Person xmlns:xsi="..." xsi:noNamespaceSchemaLocation="myfile.xsd">

XML (this DOES NOT validate)
<Person xmlns:xsi="..." xsi:noNamespaceSchemaLocation="myfile.xsd">

For more information on Standard Life, visit our website

The Standard Life Assurance Company, Standard Life House, 30 Lothian Road,
Edinburgh EH1 2DH, is registered in Scotland (No. SZ4) and regulated by the
Financial Services Authority. Tel: 0131 225 2552 - calls may be recorded or
monitored. This confidential e-mail is for the addressee only. If received
in error, do not retain/copy/disclose it without our consent and please
return it to us. We virus scan and monitor all e-mails but are not
responsible for any damage caused by a virus or alteration by a third party
after it is sent. 
Received on Wednesday, 10 July 2002 19:12:24 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:00 UTC