- From: Dare Obasanjo <dareo@microsoft.com>
- Date: Tue, 27 Aug 2002 07:28:11 -0700
- To: "Stefan Wachter" <Stefan.Wachter@gmx.de>, "Mesa Capela Encarnacion" <EMesa@sogecable.com>, <xmlschema-dev@w3.org>
Where in your link does it say that if an attribute is required then it cannot have a fixed value? -----Original Message----- From: Stefan Wachter [mailto:Stefan.Wachter@gmx.de] Sent: Tue 8/27/2002 3:42 AM To: Mesa Capela Encarnacion; xmlschema-dev@w3.org Cc: Subject: Re: Attribute use in XML schemas 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 10:28:46 UTC