RE: top-level attribute declaration

> -----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 UTC