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

Re: XSV not allowing empty fixed/default elements

From: Jeff Rafter <jeffrafter@definedweb.com>
Date: Wed, 6 Jun 2001 23:05:38 -0700
Message-ID: <00cd01c0ef17$e07f76b0$f181fea9@lazarus>
To: "Roger L. Costello" <costello@mitre.org>
Cc: <xmlschema-dev@w3.org>
Roger,

Both look valid to me.  It is probably an error in either a) the timing of
supplying the fixed value or b) the support for the fixed attribute of the
element element.

This may be the case-- also the coverage document states that there is still
some work to do on simpleType validation... this might be included in that
group-- although it isn't the type validation per se that is the problem.

Regards,
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting

----- Original Message -----
From: "Roger L. Costello" <costello@mitre.org>
To: <xmlschema-dev@w3.org>; "Costello,Roger L." <costello@mitre.org>
Sent: Saturday, May 26, 2001 6:15 AM
Subject: XSV not allowing empty fixed/default elements


> 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 Thursday, 7 June 2001 02:05:52 GMT

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