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.

--Stefan

> 
> 
> 
> 
> 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 06:42:41 GMT

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