- From: Michael Kay <mike@saxonica.com>
- Date: Tue, 6 Jan 2009 15:35:20 -0000
- To: "'Bharath Kumar Reddy T'" <bharathkr@huawei.com>, <xmlschema-dev@w3.org>
- Message-ID: <E986D9E7B9664588BAA6FF56B9EBFAB3@Sealion>
I don't know of any rule that makes this illegal (try it on some processors to check). But it's certainly meaningless. (It certainly doesn't mean that the attribute is allowed provided its value isn't "A", if that's what you were thinking!) Michael Kay http://www.saxonica.com/ _____ From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On Behalf Of Bharath Kumar Reddy T Sent: 06 January 2009 13:26 To: xmlschema-dev@w3.org Subject: Attribute declaration when use="prohibited" Hi all, If the attribute declaration has use="prohibited", Can we have simpleType as child of attribute? EX: <xs:attribute name="Second_Attribute" use="prohibited"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="A" /> </xs:restriction> </xs:simpleType> </xs:attribute> Can anybody tell me whether the above attribute declaration is correct or not?? Thanks and Regards, Bharath. _____ From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On Behalf Of Bharath Kumar Reddy T Sent: Monday, January 05, 2009 3:52 PM To: xmlschema-dev@w3.org 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 Tuesday, 6 January 2009 15:36:00 UTC