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

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

From: A. Del Rio <adelrio@decadesystems.com>
Date: Thu, 13 Feb 2003 08:57:09 -0500
To: "'Gabriele Zannoni'" <gzannoni@deis.unibo.it>, <xmlschema-dev@w3.org>
Message-ID: <000601c2d367$d005abc0$6e12a8c0@decade.lan>

Hi Gabriele,

Your instance document in invalid because you have both elements listed.
The compositor you are using is "Choice" which means that your element
"root" must only contain either "e1" or "e2".  "e1" is not empty therefore
you are trying to insert both elements.  Try using a the "sequence"

Sincere Regards,

Andy DelRio

-----Original Message-----
From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Gabriele Zannoni
Sent: Thursday, February 13, 2003 7:36 AM
To: xmlschema-dev@w3.org
Subject: Re: Element default problem - This is the last (I hope...)

MSXML4.0 says that according to this schema:

<xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="root">
   <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"/>

the document:

 <e1 />

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?

Received on Thursday, 13 February 2003 08:59:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:09 UTC