W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2001

Re: attribute definitions inside xsd:restriction?

From: R. Mark Volkmann <mark.volkmann@home.com>
Date: Mon, 16 Apr 2001 18:51:49 -0500
Message-ID: <054201c0c6d0$398c5810$8d971618@C632294A>
To: "Volkmann, Mark" <Mark.Volkmann@agedwards.com>, "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
Cc: <www-xml-schema-comments@w3.org>
----- 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:50 GMT