W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

RE: top-level attribute declaration

From: Schramm, Oliver <schramm@sony.de>
Date: Thu, 24 Jan 2002 19:15:02 +0100
Message-ID: <B0793DB946E52942A49C1E8152A1358C04EA5D@leo.wins.fb.sony.de>
To: "'Stanley Guan'" <stanley.guan@oracle.com>
Cc: xmlschema-dev@w3.org


> -----Original Message-----
> From: Stanley Guan [mailto:stanley.guan@oracle.com]
> Sent: Donnerstag, 24. Januar 2002 18:33
> To: Schema XML
> Subject: top-level attribute declaration
> 
> 
> Hi,
> 
> Is the following 2nd attribute declaration valid?
> 
>  <!-- these are top-level attribute declarations -->
>  <xsd:attribute name="ga1" type="xsd:integer"/>
>  <xsd:attribute ref="ga1"/>
> 

Hey Stanley,

I'm not sure what the idea is behind that. But I think
you can not do that, have a look at 'XML Schema Part 1: Structures'
Section 3.x.3. 


I tested that with the following schema and Xerces 1.4.4
and you get an error message.

<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified"
           version="1.0">

  <xs:attribute name="fooAttr1" type="xs:integer"/>
  <xs:attribute ref="fooAttr1"/>

  <xs:element name="fooElement">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="xs:anyType">
          <xs:attribute name="fooAttr1" type="xs:integer"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
</xs:schema>


As I said, I'm not sure why you need that ??

regards

Oliver

> 
> Thx,
> 
> -Stanley
> 
Received on Thursday, 24 January 2002 13:17:19 GMT

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