Mukul, >From spec 3.2.6.4:
> Note: It is legal for Attribute Uses that refer to xsi: attributes ... And from 3.17.6.2 > 4.2 otherwise the ·namespace name· of the ·QName· is the same as one of the following: ... > 4.2.4 http://www.w3.org/2001/XMLSchema-instance. These 2 combined allow a reference to an xsi: attribute without an <import>. So I think the test is valid. > Here are few questions and thoughts: > 1. Does Xerces looks non compliant according to this test? Yes for schema 1.1. In schema 1.0 [1], the rule is specified in 3.15.3 "Schema Representation Constraint: QName resolution (Schema Document)". It didn't have any treatment for the built-in components, which means you couldn't even refer to "xs:string" without an import. This is obviously wrong. Xerces took the position to allow references to the built-in types in the "xs" namespace, without needing an <import>. Schema 1.1 fixed this problem, by allowing not only references to "xs" types, but also "xsi" attributes. And not only built-in components, but any components in those namespaces. So Xerces needs to be updated accordingly. [1] http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#src-resolve > 2. Xerces doesn't allow an attribute declaration whose targetNamespace > is http://www.w3.org/2001/XMLSchema-instance. So it seems we can't do > currently for example with Xerces, Not necessarily true. Declaring attributes in the xsi namespace is still forbidden. Xerces doesn't need to change in that regard. The test is not declaring an attribute, but referring to one. > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > targetNamespace=" http://www.w3.org/2001/XMLSchema-instance"> > > <xs:attribute name="noNamespaceSchemaLocation" type="xs:anyURI" /> > > </xs:schema> > > and import this schema in the test suite schema [1] to solve this use-case. This should not be necessary. See the rule cited above (from 3.17.6.2). > Do we have a schema somewhere on web (perhaps on www.w3.org site), > from where we can import the definitions of namespace > http://www.w3.org/2001/XMLSchema-instance instead of users writing a > schema like [2] to provide these definitions themselves? a. Not necessary (see above). b. Illegal. The xsi: attributes (like xs: types) are built-in components, and should not be declared in schema documents. (Schema 1.1 removed the built-in types from the schema for schemas.) See the first note you quoted. c. Especially not on w3.org. See [2]. [2] http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic > 3. Interestingly the following schema using XML Schema 1.1 assertions > seem to solve the problem for this use case, Yes, people can always do that. I don't think this is an interesting "use case". It doesn't seem to be good design to do anything with the xsi: attributes in the schema. Thanks, Sandy Gao XML Technologies, IBM Canada Editor, W3C XML Schema WG (1-905) 413-3255 T/L 313-3255 [email protected]
