W3C home > Mailing lists > Public > www-ws-desc@w3.org > January 2005

What Happens if 2 Inline Schemas Define the Same Element?

From: Arthur Ryman <ryman@ca.ibm.com>
Date: Thu, 27 Jan 2005 12:57:51 -0500
To: www-ws-desc@w3.org
Message-ID: <OF6C4CF148.4BBDB8E0-ON85256F96.0060E756-85256F96.0062AE4F@ca.ibm.com>
We discussed this in the telecon today. I ran a little experiment. 
Consider the master file:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace=
"http://www.ibm.com/foo" xmlns:tns="http://www.ibm.com/foo">
        <include schemaLocation="foo-int.xsd"></include>
        <include schemaLocation="foo-string.xsd"></include>
</schema>

Where foo-int.xsd is:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace=
"http://www.ibm.com/foo" xmlns:tns="http://www.ibm.com/foo">
        <element name="foo" type="int"></element>
</schema>

and foo-string.xsd is:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace=
"http://www.ibm.com/foo" xmlns:tns="http://www.ibm.com/foo">
        <element name="foo" type="string"></element>
</schema>

I validated the master document and got an error: 


I then changed the definition of foo-string so that it was identical to 
foo-int and got the same error message.

The moral of the story is that the XML schema validator just looked at the 
QName and when that was duplicated it raised an error, even of the 
defintions were identical.

Arthur Ryman,
Rational Desktop Tools Development

phone: +1-905-413-3077, TL 969-3077
assistant: +1-905-413-2411, TL 969-2411
fax: +1-905-413-4920, TL 969-4920
mobile: +1-416-939-5063, text: 4169395063@fido.ca
intranet: http://labweb.torolab.ibm.com/DRY6/

picture
(image/gif attachment: 01-part)

Received on Thursday, 27 January 2005 17:58:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:58:34 GMT