NameAndTypeOK No. 4

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 UTC