Using attributes from non-schema namespace as metadata on the sch ema

In  <http://www.w3.org/TR/xmlschema-1/#declare-element>
http://www.w3.org/TR/xmlschema-1/#declare-element it says that an element
declaration can contain "{any attributes with non-schema namespace . . .}>"
 
In  <http://lists.w3.org/Archives/Public/xmlschema-dev/2001Jan/0004.html>
http://lists.w3.org/Archives/Public/xmlschema-dev/2001Jan/0004.html Henry
states that <xs:element name="foo" type="my:baz" hack:extra="banana"/> is
valid in a context where 'xs', 'my' and 'hack' are all properly declared.
 
David Cleary also talks about adding attributes from another namespace, and
the presentation he references says n"Conforming processors will ignore
these attributes"
http://lists.w3.org/Archives/Public/xmlschema-dev/2001Jan/0003.html
<http://lists.w3.org/Archives/Public/xmlschema-dev/2001Jan/0003.html> 
 
I'm trying to use these techniques, but both XSV and XMLSpy complain that my
schema is invalid.
"Warning: Undeclared attribute vc:role for element xs:element in unnamed
entity at line 9 char 35 of file:/D:/source/graph.xsd"
Am I doing something wrong, or am I dealing with non-conforming processors?
I also tried adding 
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance> "
xsi:schemaLocation="urn:MySchema vc.xsd" instead of xs:import, to no avail.

Thanks,
Casey
 
vc.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="  <http://www.w3.org/2001/XMLSchema>
http://www.w3.org/2001/XMLSchema" 
    targetNamespace="urn:MySchema" 
              xmlns="urn:MySchema">
  <xs:attribute name="role" type="xs:string"/>
</xs:schema>
 
graph.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema        xmlns:xs=" http://www.w3.org/2001/XMLSchema
<http://www.w3.org/2001/XMLSchema> " 
                 xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance
<http://www.w3.org/2001/XMLSchema-instance> " 
           targetNamespace="urn:graphing" 
                     xmlns="urn:graphing" 
           xmlns:vc="urn:MySchema"   
        elementFormDefault="qualified">
  <xs:import namespace="urn:MySchema" schemaLocation="vc.xsd"/>
  <xs:element name="graph" vc:role="my role">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="object" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="objectReference" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="idref" type="xs:IDREF"
use="required"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
 
 
 
 
 
 

Received on Saturday, 7 July 2001 09:30:44 UTC