Hi there,

Eric Ye wrote:
> it is sort of a pending issue. but only when you use
> "noTargetNamespaceLocation".
> Please use a schema with targetNameSpace defined for you sample to avoid
> this problem.

I actually do want to use a targetNamespace, I just thought I'd send in
a simplified example. Below are the documents again, this time with
namespaces. The problem is still the same.

> about how to bind unprefixed names in the instance document. Anyway, if you
> want to use noTargetNamespaceLocation, for now, don't use any duplicate
> names for elements and types, this issue will be solved after W3C wg clearly

I think it's a scope problem. The two elements with the same name are
declared locally in two different complexTypes. I looked again in the
spec (http://www.w3.org/TR/xmlschema-1) and section 2.5 explicitly
states in the last paragraph that what I'm doing is allowed.

Xerces version used: 1.1.2

Documents to reproduce behaviour:

<?xml version="1.0"?>
<schema version="1.0"
 targetNamespace="test"
 xmlns="http://www.w3.org/1999/XMLSchema";
 xmlns:tst="test"
 elementFormDefault="qualified"
>
  <complexType name="a-type">
    <element name="elem" type="string"/>
  </complexType>
  <element name="a" type="tst:a-type"/>
  <complexType name="b-type">
    <element name="elem" type="string"/>
  </complexType>
  <element name="b" type="tst:b-type"/>
</schema>

<?xml version="1.0"?>
<a
 xmlns="test"
 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
 xsi:schemaLocation="test test.xsd"
>
  <elem>hello</elem>
</a>

Best regards

  Andreas

-- 
ISB GmbH                  Phone ++49 721 82800-40 or -0
Karlstraße 52-54          Fax   ++49 721 82800-82
76133 Karlsruhe           mailto:[EMAIL PROTECTED]
Germany                   http://www.isb-ka.de

Reply via email to