Re: attribute definitions inside xsd:restriction?

----- Original Message -----
From: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
To: "Volkmann, Mark" <Mark.Volkmann@agedwards.com>
Cc: <www-xml-schema-comments@w3.org>; <mark.volkmann@home.com>
Sent: Monday, April 16, 2001 4:12 PM
Subject: Re: attribute definitions inside xsd:restriction?


> "Volkmann, Mark" <Mark.Volkmann@agedwards.com> writes:
>
> <snip/>
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
> >                 elementFormDefault="qualified">
> >  <xsd:element name="root">
> >   <xsd:complexType>
> >    <xsd:simpleContent>
> >     <xsd:restriction base="xsd:string">
> >      <xsd:attribute name="attr" type="xsd:string" use="required"/>
> >     </xsd:restriction>
> >    </xsd:simpleContent>
> >   </xsd:complexType>
> >  </xsd:element>
> > </xsd:schema>
> >
> > Why should the attribute now be defined inside <xsd:restriction>
> > which defines the content?  I think <xsd:attribute> should still be
> > a child of <xsd:complexType>.
>
> The above is actually broken -- you must _extend_ string with
> attributes.  The following is the correct definition
>
> > <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
> >                 elementFormDefault="qualified">
> >  <xsd:element name="root">
> >   <xsd:complexType>
> >    <xsd:simpleContent>
> >     <xsd:extension base="xsd:string">
> >      <xsd:attribute name="attr" type="xsd:string" use="required"/>
> >     </xsd:extension>
> >    </xsd:simpleContent>
> >   </xsd:complexType>
> >  </xsd:element>
> > </xsd:schema>

This still has the issue that the attribute "attr" is defined inside
<xsd:simpleContent> even though the attribute belongs to the element "root",
not to its content.

Received on Monday, 16 April 2001 19:51:13 UTC