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

Re: Attribute use in XML schemas

From: Stefan Wachter <Stefan.Wachter@gmx.de>
Date: Tue, 27 Aug 2002 12:42:09 +0200 (MEST)
To: "Mesa Capela Encarnacion" <EMesa@sogecable.com>; xmlschema-dev@w3.org
Message-ID: <26998.1030444929@www59.gmx.net>

Attributes that are required are not allowed to have a fixed or default
value. This was discussed  in this newsgroups some days ago. The relevant link
is: http://www.w3.org/TR/xmlschema-1/#src-attribute.


> 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
> this schema I define a complex type with three attributes. I set the use
> 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:
> 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
> 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
> 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 06:42:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:05 UTC