W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

Re: Element default problem - This is the last (I hope...)

From: Gabriele Zannoni <gzannoni@deis.unibo.it>
Date: Thu, 13 Feb 2003 13:36:05 +0100
Message-ID: <005b01c2d35c$7f1d3df0$8119fea9@gabriele>
To: <xmlschema-dev@w3.org>

MSXML4.0 says that according to this schema:

<xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="root">
  <xs:complexType>
   <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element name="e1" type="xs:token" default="N/A"/>
    <xs:element name="e2" type="xs:integer" default="12"/>
   </xs:choice>
  </xs:complexType>
 </xs:element>
</xs:schema>

the document:

<root>
 <e1 />
 <e2></e2>
</root>

is not valid because (I copy the msxml response):
The value of '' is invalid according to its data type.
The element: e2 has an invalid value according to its data type.

The first sentence tells us that the "empty string" is not a valid value
(probably for e2).
The second sentence... tells the rest.

So, for the last time (I promise!): is MSXML4 wrong?

Thanks,
Gabriele
Received on Thursday, 13 February 2003 07:35:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT