[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Duplicate attribute uses (Xerces bug?)

From: George Cristian Bina <george@sync.ro>
Date: Mon, 12 Sep 2005 15:00:40 +0300
Message-ID: <43256DE8.7010400@sync.ro>
To: kbuchcik@4commerce.de
Cc: XML-SCHEMA <xmlschema-dev@w3.org>
xml error duplicate attribute

Hi,

See http://www.w3.org/TR/xmlschema-1/#ct-props-correct
4 Two distinct attribute declarations in the {attribute uses} must not 
have identical {name}s and {target namespace}s.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


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.
> 
> 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
> Xerces:
> 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'.
> 
> 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 Monday, 12 September 2005 11:54:08 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.