W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2001

XSV not allowing empty fixed/default elements

From: Roger L. Costello <costello@mitre.org>
Date: Sat, 26 May 2001 09:15:09 -0400
Message-ID: <3B0FAC5D.4FB9C9BA@mitre.org>
To: xmlschema-dev@w3.org, "Costello,Roger L." <costello@mitre.org>
Hi Folks,

From reading the portion of the structures specification on
fixed/default values for elements, it is my understanding that if in a
schema I declare an element to be fixed:

   <xsd:element name="one" type="xsd:unsignedByte" fixed="1"/>

then in an instance document I can either explicitly specify the value:


or, I can leave the element empty:


I have found that XSV accepts the former but not the later.  That is, it


but does not accept:


The error message that XSV gives is:

"element content failed type check: does not represent a number"

Is this a bug in XSV, or incorrect understanding on my part?  /Roger

Here's the relevant discussion from the structure's spec:

"{value constraint} establishes a default or fixed value for an element.
If default is specified, and if the element being validated is empty,
then the canonical form of the supplied constraint value becomes the
[schema normalized value] of the validated element in the
post-schema-validation infoset. If fixed is specified, then the
element's content must either **be empty**, in which case fixed behaves
as default, or its value must **match the supplied constraint value**."
Received on Saturday, 26 May 2001 09:15:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:51 UTC