W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

Re: extension and restriction

From: Niko Suave <niko@alum.mit.edu>
Date: Wed, 5 Dec 2001 03:06:12 -0500 (EST)
To: Eddie Robertsson <eddie@allette.com.au>
cc: Jeni Tennison <jeni@jenitennison.com>, xmlschema-dev@w3.org
Message-ID: <Pine.LNX.4.21.0112050304290.11688-100000@sub-zero.mit.edu>
> > > I don't understand exactly what you mean here. Are you talking about
> > > something like:
> > >
> > > <xs:complexType name="base">
> > >   <xs:attribute name="name" type="xs:string"/>
> > >   <xs:attribute name="dead" type="xs:boolean"/>
> > >   <xs:anyAttribute namespace="##other" />
> > > </xs:complexType>
> > >
> > > <xs:complexType name="extension">
> > >   <xs:complexContent>
> > >     <xs:extension base="base">
> > >       <xs:attribute name="xlink:href" type="xs:anyURI"
> > >                     use="prohibited" />
> 
> Isn't the above attribute declaration invalid because as far as I know the name
> attribute must match an NCName?
> Maybe there is a special rule for this when you extend or restrict a complexType
> that I've missed out on...

Well, you could rewrite this like so and have the same ambiguity, right?

<xs:complexType name="base">
  <xs:anyAttribute namespace="##target" />
</xs:complexType>

<xs:complexType name="restriction">
  <xs:complexContent>
    <xs:restriction base="base">
      <xs:attribute name="href" type="xs:anyURI" use="prohibited" />
    </xs:restriction>
  </xs:complexContent>
</xs:complexType>


niko
Received on Wednesday, 5 December 2001 03:02:11 GMT

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