- From: Roger L. Costello <costello@mitre.org>
- Date: Sat, 26 May 2001 09:15:09 -0400
- 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: <one>1</one> or, I can leave the element empty: <one/> I have found that XSV accepts the former but not the later. That is, it accepts: <one>1</one> but does not accept: <one/> 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