W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2005

Re: Duplicate attribute uses (Xerces bug?)

From: Kasimier Buchcik <K.Buchcik@4commerce.de>
Date: Wed, 21 Sep 2005 12:14:17 +0200
To: kbuchcik@4commerce.de
Cc: XML-SCHEMA <xmlschema-dev@w3.org>
Message-Id: <1127297657.1274.34.camel@librax>

Hi,

On Mon, 2005-09-12 at 13:29 +0200, Kasimier Buchcik wrote:
> Hi,
> 
> Don't worry; this is not related to schema construction.
> I get an error report from Xerces-J 2.7.1 when
> prohibiting and defining an equal attribute use in the
> same type.

Added results from SQC and Saxon 8.5.1; update of XSV
result (see below).

> attr.xsd
> --------
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 	targetNamespace="urn:test:foo"
> 	xmlns:f="urn:test:foo">
> 
> 	<xsd:complexType name="base">
> 		<xsd:attribute name="boo" use="optional"/>
> 	</xsd:complexType>
> 
> 	<xsd:complexType name="type">
> 		<xsd:complexContent>
> 			<xsd:restriction base="f:base">
> 				<xsd:attribute name="boo" use="prohibited"/>
> 				<xsd:attribute name="boo"/>
> 			</xsd:restriction>
> 		</xsd:complexContent>
> 	</xsd:complexType>
> 
> 	<xsd:element name="foo" type="f:type"/>
> </xsd:schema>
> 
> attr.xml
> --------
> <foo xmlns="urn:test:foo"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="urn:test:foo attr.xsd"/>
> 
> XSV: no errors
XSV 2.10 (error):

<schemaError char="5" line="14" phase="instance"
resource="file:///p:/libxml2-lab/tests/2005-09-12/attr.xsd">
attempt to redeclare attribute {None}:boo, ignored
</schemaError>

Xerces 2.7.10 (error):
> attr.xsd:14,32: (Error) ct-props-correct.4: Error for type 'type'.
> Duplicate attribute uses with the same name and target namespace are
> specified.  Name of duplicate attribute use is 'boo'.

SQC (no errors):

PROCESSING p:\libxml2-lab\tests\2005-09-12\attr.xsd time :
2005-09-21T12:07:31 ...
p:\libxml2-lab\tests\2005-09-12\attr.xsd (file 1 of 1) now being
read ...
 NO ERROR 
end time = 2005-09-21T12:07:31

Saxon 8.5.1 (error):

Error on line 10 of file:/p:/libxml2-lab/tests/2005-09-12/attr.xsd:
  Attribute @boo appears more than once in attribute group
Warning: The schema is invalid
Validation error 
  Cannot validate <foo>: no element declaration available
Validation of source document failed

> IFAIK prohibiting an attribute does not create an attribute use
> component and is just a mechanism to prohibit attribute uses
> of the base type. So I see no error here.
> Thoughts?

Regards,

Kasimier
Received on Wednesday, 21 September 2005 10:15:05 GMT

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