Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Attribute prohibition with a "ref"

From: Kasimier Buchcik <K.Buchcik@---------.-->
To: XML-SCHEMA <xmlschema-dev@--.--->
Date: 9/27/2005 7:45:00 PM
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"=09
	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 =B7actual value=B7 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

From K.Buchcik@4... Tue Sep 27 15:57:18 2005
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent