W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2001

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

From: Casey Mullen <Casey.Mullen@bentley.com>
Date: Fri, 6 Jul 2001 14:10:35 -0400 (EDT)
Message-ID: <93C0BE6A6D6AD211BC7400A0C9D8FE8703B9B1AE@exton1.bentley.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:22 GMT