attributes with prefix in schema

Hi all. I'm trying to understand how to process attributes with prefix in
schema.

The following segment is from "schema for schemas":

 <xs:complexType name="openAttrs">
   <xs:annotation>
     <xs:documentation>
       This type is extended by almost all schema types
       to allow attributes from other namespaces to be
       added to user schemas.
     </xs:documentation>
   </xs:annotation>
   <xs:complexContent>
     <xs:restriction base="xs:anyType">
       <xs:anyAttribute namespace="##other" processContents="lax"/>
     </xs:restriction>
   </xs:complexContent>
 </xs:complexType>

I have three questions:

1. "This type is extended by almost all schema types to allow attributes
from other namespaces to be added to user schemas." How about attributes
from the schema namespace? For example:
   <xsd:element name="ele" type="xsd:string" xsd:use="invalid"/>
Is "xsd:use" considered to be the same as "use", or is it not allowed to
appear?

2. Does anyone know what are the exceptions of "almost all schema types"? I
went through all XML Representations of schema elements. It seems to me
that "{any attributes with non-schema namespace . . .}" doesn't appear in
"group", "appInfo", and "document", so I suspect that these 3 doesn't allow
attributes from other namespaces. Then I checked the schema for schemas,
but "group" seems to have two different types: groupRef and namedGroup,
where the first one extends "openAttrs" and the second one doesn't. Is this
an errata? I would think that "group" should also allow attributes from
other namespaces. (Otherwise, what makes it so different from others?)

3. Notice that processContents="lax", so it means we should validate those
attributes if we can find the declarations. Then where are we supposed to
find such declarations? Consider an example:

<xsd:schema xmlns:xsd="..." xmlns:test="test" targetNamespace="test">
  <xsd:attribute name="att" type="xsd:decimal"/>
  <xsd:element name="ele" test:att="invalid"/>
</xsd:schema>

Then are we supposed to validate "test:att" against the type "xsd:decimal"?

Thanks,
Sandy Gao
Software Developer, IBM Canada
(1-416) 448-3255
sandygao@ca.ibm.com

Received on Tuesday, 19 June 2001 09:17:37 UTC