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

Re: Reg. Attribute declaration

From: Pete Cordell <petexmldev@codalogic.com>
Date: Mon, 5 Jan 2009 10:51:49 -0000
Message-ID: <256357F059DE4A4D9D48FD43EF91D7BD@Codalogic>
To: "Bharath Kumar Reddy T" <bharathkr@huawei.com>, <xmlschema-dev@w3.org>

The order is important.  The annotation should come before the simpleType. 
If you do that everything should be OK.

HTH,

Pete.
--
=============================================
Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ for more info
=============================================

----- Original Message ----- 
From: "Bharath Kumar Reddy T" <bharathkr@huawei.com>
To: <xmlschema-dev@w3.org>
Sent: Monday, January 05, 2009 10:21 AM
Subject: Reg. Attribute declaration


> Hi..
>
> According to schema spec. the attribute declaration is
>
>
>
> <attribute
>  default = string
> <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#string>
>  fixed = string
> <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#string>
>  form = (qualified | unqualified)
>  id = ID
> <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#ID>
>  name = NCName
> <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#NCName>
>  ref = QName
> <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#QName>
>  type = QName
> <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#QName>
>  use = (optional | prohibited | required) : optional
>  {any attributes with non-schema namespace . . .}>
>  Content: (
> <http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#element-annotation>
> annotation?,
> <http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#element-simpleType>
> simpleType?)
> </attribute>
>
>
>
> (i.e) attribute declaration content can be "annotation" and "simpleType".
> When I give a complexType as follows,
>
>
>
> <xs:attribute name="Second_Attribute" use="prohibited">
>
>                                   <xs:simpleType>
>
>                                          <xs:restriction base="xs:string">
>
>                                                 <xs:enumeration value="A"
> />
>
>                                          </xs:restriction>
>
>                                   </xs:simpleType>
>
>
>
>                                   <xs:annotation>
>
> <xs:documentation>
>
> Adkssan
>
> </xs:documentation>
>
> </xs:annotation>
>
> </xs:attribute>
>
>
>
> Where I have given both annotation and SimpleType.
>
> Altova spy is giving error that "annotation element is not allowed". But
> according to schema spec, I think this is correct.
>
> Can anybody tell me whether this is an error or not an error.
>
>
>
> Thanks and Regards,
>
> Bharath.
>
>
>
> 
Received on Monday, 5 January 2009 10:52:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:50 UTC