W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2002

Attribute use in XML schemas

From: Mesa Capela, Encarnacion <EMesa@sogecable.com>
Date: Tue, 27 Aug 2002 03:35:14 -0400 (EDT)
Message-ID: <9A8A23C685A3544AA607B3C52CDE9B0D047CAE@PLUSEXCHANGE.plus.es>
To: <xmlschema-dev@w3.org>




Hello!

I am trying to define an XML document that conforms to a particular schema, and I have the following problem: I define a first XML schema, and in this schema I define a complex type with three attributes. I set the use of these attributes to required, and I set one of this attributes to a fixed value. 

Then I define a second XML schema, based on the first schema. In this second schema, I define an element of the previous complex type, and set another attribute to a fixed value. 

Finally I define an XML document based on the second schema. In this XML document I see the element with the following values for the attributes: the attribute I defined in the first schema appears in the XML document as required, with the fixed value. Nevertheless, the attribute that I set to a fixed value in the second schema appears in the XML document as optional, instead of required, with the fixed value. Why this attribute is not included as required in the XML document?. In the initial definition of the attribute, the use was set to required, and I only add a fixed value for it, but I didn't change the use of the attribute. Moreover, the use of the first attribute is very similar, and this attribute is included as required, with the fixed value, in the XML document. 

On the other hand, when I define a complex type in an XML schema, I define an XML document based on this schema, with an element of the complex type, and try to derive by restriction the complex type, I cannot modify the facets of the attributes. Is it not possible to do this?. Why?.

Thanks. 

Best wishes, 

Encarna
Received on Tuesday, 27 August 2002 04:12:25 GMT

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