Attribute prohibition with a "ref"

Hi,

Does the spec mention how to handle the following
piece of XML representation?

<xs:attribute ref="myns:someAttr" use="prohibited"/>

Libxml2 gets confused with this, so I want to fix this.

Test case:

attr-gr-1.xsd
-------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"	
	targetNamespace="urn:test:foo"
	xmlns:f="urn:test:foo">

	<xs:attribute name="bar"/>

	<xs:complexType name="base">
		<xs:attribute name="bar"/>
	</xs:complexType>

	<xs:element name="foo">
		<xs:complexType>
			<xs:complexContent>
				<xs:restriction base="f:base">
					<xs:attribute ref="f:bar" use="prohibited"/>
				</xs:restriction>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>

</xs:schema>

attr-gr-1.xml
-------------
<foo xmlns="urn:test:foo"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="urn:test:foo attr-gr-1.xsd"
	bar="lala"/>


Xerces-J 2.7.1 and XSV 2.10: no errors.

Libxml2: No errors by accident due to a malfunction.

Saxon 8.5.1:

Error on line 13 of file:/p:/libxml2-lab/tests/2005-09-27/attr-gr-1.xsd:
  Invalid restriction: attribute @bar is not defined in the base type
Error on line 13 of file:/p:/libxml2-lab/tests/2005-09-27/attr-gr-1.xsd:
  The attributes of complex type of element foo are not a restricted
subset of the
  attributes of the type base
Warning: The schema is invalid

SQC:

ERROR
 file = file:P:/libxml2-lab/tests/2005-09-27/attr-gr-1.xsd line 19
column 20
SEVERITY: 0
ERROR TYPE: 2
MESSAGE 
 Attribute bar's use is prohibited, but the base type did not include an
attribute named bar.


>From the definition for {attribute uses} of complex types:

"...3.2 what would have been the {name} and {target namespace} of the
{attribute declaration} of an attribute use in the set per clause 1
above but for the ·actual value· of the use [attribute] of the relevant
<attribute> among the [children] of <restriction> being prohibited."

Is it true that this does not say whether this 'imagined' 
attribute declaration _must_ be locally declared? So one can
use attribute references as well?

Additionally, there's no constraint in the spec, which does rule
out all the other (useless) attributes of an <xs:attribute> if it
comes as a prohibition, right?

Regards,

Kasimier

Received on Tuesday, 27 September 2005 15:48:40 UTC