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

NameAndTypeOK No. 4

From: Rainer Becker <rainerbecker.mail@t-online.de>
Date: Mon, 13 Jan 2003 22:22:27 +0100
Message-ID: <3E232E13.B0D692C1@t-online.de>
To: xmlschema-dev@w3.org

Hallo newsgroup readers,

This question is about the correct interpretation of the spec.

In the Structures Spec, the Schema Component Constraint reads:

Schema Component Constraint:
Particle Restriction OK (Elt:Elt -- NameAndTypeOK)

For an element declaration particle to be a ·valid restriction·
of another element declaration particle all of the following must be
true:

4 either B's declaration's {value constraint} is absent, or is not
  fixed, or R's declaration's {value constraint} is fixed with the same
value.


The following overview contains two lines. The first line contains
an element declaration particle in the base type, the second line
the one in the restricted type.

According to my understanding, the following is allowed:

   <xsd:element name="B" type="xsd:string" />
   <xsd:element name="B" type="xsd:string" />

   <xsd:element name="B" type="xsd:string" />
   <xsd:element name="B" type="xsd:string" default="test" />

   <xsd:element name="B" type="xsd:string" default="test" />
   <xsd:element name="B" type="xsd:string" />

   <xsd:element name="B" type="xsd:string" default="test" />
   <xsd:element name="B" type="xsd:string" default="test"/>


   <xsd:element name="B" type="xsd:string" fixed="test" />
   <xsd:element name="B" type="xsd:string" fixed="test"/>

while the following would be invalid derivations

   <xsd:element name="B" type="xsd:string" fixed="test" />
   <xsd:element name="B" type="xsd:string" />

   <xsd:element name="B" type="xsd:string" fixed="test" />
   <xsd:element name="B" type="xsd:string" default="test" />


at that point I was sure that "is fixed with the same value"
meant, that fixed can only be used in both, the base type and
the restricted type with an identical value , but unfortunately,
the following two validate just fine.

   <xsd:element name="B" type="xsd:string" />
   <xsd:element name="B" type="xsd:string" fixed="test"/>

   <xsd:element name="B" type="xsd:string" default="test" />
   <xsd:element name="B" type="xsd:string" fixed="test" />

Question: What does fixed with the same value mean?, or
          is it a parser error, please help!

Thank you, very much

Regards

Rainer
Received on Monday, 13 January 2003 16:40:24 GMT

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