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

xsd:element attributes with non-schema namespace

From: D Gross <justdave@onebox.com>
Date: Fri, 10 Aug 2001 11:58:32 -0400 (EDT)
To: xmlschema-dev@w3.org
Message-Id: <20010810155748.RALI297.mta10.onebox.com@onebox.com>
I have a question about attributes with a non-schema namespace in an
xsd:element definition.  For example, I want to add an attribute "my:attr"
in the following way:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
	<xsd:element name="test" my:attr="something"/>

Seems the CR XML Schema does not allow this, at least according to a
couple of tools that I have tried using to validate the schema:

"This file is not valid: Unexpected attribute 'my:attr' in element 'xsd:element'"

I believe this should be allowable, according to the XML Schema spec.
 Note the
"{any attributes with non-schema namespace . . .}" below:

  abstract = boolean : false
  block = (#all | List of (extension | restriction | substitution)) 
  default = string 
  final = (#all | List of (extension | restriction)) 
  fixed = string 
  form = (qualified | unqualified)
  id = ID 
  maxOccurs = (nonNegativeInteger | unbounded)  : 1
  minOccurs = nonNegativeInteger : 1
  name = NCName 
  nillable = boolean : false
  ref = QName 
  substitutionGroup = QName 
  type = QName 
  {any attributes with non-schema namespace . . .}>
  Content: (annotation?, ((simpleType | complexType)?, (unique | key
| keyref)*))

Then I looked at the relevant XML schema definition in XMLSchema.xml
off of the w3c website:

	<xs:complexType name="element" abstract="true">
   The element element can be used either
   at the top level to define an element-type binding globally,
   or within a content model to either reference a globally-defined
   element or type or declare an element-type binding locally.
   The ref form is not allowed at the top level.</xs:documentation>
			<xs:extension base="xs:annotated">
					<xs:choice minOccurs="0">
						<xs:element name="simpleType"
						<xs:element name="complexType"
					<xs:group ref="xs:identityConstraint"
minOccurs="0" maxOccurs="unbounded"/>
				<xs:attributeGroup ref="xs:defRef"/>
				<xs:attribute name="type" type="xs:QName"/>
				<xs:attribute name="substitutionGroup"
				<xs:attributeGroup ref="xs:occurs"/>
				<xs:attribute name="default" type="xs:string"/>
				<xs:attribute name="fixed" type="xs:string"/>
				<xs:attribute name="nillable" type="xs:boolean"
use="optional" default="false"/>
				<xs:attribute name="abstract" type="xs:boolean"
use="optional" default="false"/>
				<xs:attribute name="final" type="xs:derivationSet"/>
				<xs:attribute name="block" type="xs:blockSet"/>
				<xs:attribute name="form" type="xs:formChoice"/>

It doesn't look like it allows for any attribute in a non-schema namespace.

This has worked prior to CR.  Should this be allowed or not?

-- Dave

FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com
Received on Wednesday, 22 August 2001 06:47:38 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC