Hello all,

I have the following stupid XML schemas and I try to parse them with
XercesC 3.1.1 (I just want to check that the schemas are ok).

file 1.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
targetNamespace="ns1.com" xmlns="ns1.com">
  <!-- Imports -->
  <xsd:import namespace="ns2.com" schemaLocation="2.xsd"/>
  <!-- Complex Types -->
  <xsd:complexType name="CT1"/>
  <xsd:complexType name="CT2">
    <xsd:sequence>
      <xsd:element name="del" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="CT3"/>
  <!-- Element Groups -->
  <xsd:group name="DelGroup">
    <xsd:sequence>
      <xsd:element name="del" type="CT1"/>
    </xsd:sequence>
  </xsd:group>
  <xsd:group name="DelGroup1">
    <xsd:sequence>
      <xsd:element name="del" type="xsd:string"/>
    </xsd:sequence>
  </xsd:group>
  <xsd:group name="InsGroup">
    <xsd:sequence>
      <xsd:element name="ins" type="CT2"/>
    </xsd:sequence>
  </xsd:group>
  <xsd:group name="UpGroup">
    <xsd:sequence>
      <xsd:element name="up" type="CT3"/>
    </xsd:sequence>
  </xsd:group>
</xsd:schema>


file 2.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
targetNamespace="ns2.com" xmlns="ns2.com" xmlns:ns1="ns1.com">
  <!-- Imports -->
  <xsd:import namespace="ns1.com" schemaLocation="1.xsd"/>
  <!-- Complex Types -->
  <xsd:complexType name="CT1"/>
  <xsd:complexType name="CT2">
    <xsd:sequence>
      <xsd:element name="pos" type="CT5"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="CT3">
    <xsd:sequence>
      <xsd:group ref="ns1:UpGroup"/>
      <xsd:group ref="ns1:InsGroup"/>
      <xsd:group ref="ns1:DelGroup"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="CT4">
    <xsd:sequence>
      <xsd:group ref="ns1:DelGroup1"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="CT5"/>
</xsd:schema>


I get the following errors when I try to load 1.xsd:
<1.xsd>:19:31: [xerces error] element 'del' declared more than once in
the same scope
<1.xsd>:9:50: [xerces error] element 'del' declared more than once in
the same scope

The code that I use for schema loading is in the attachment.

Can anybody help me understand what is wrong here? My schemas, my code
or XercesC?

Volo Zyko

Attachment: sv.tar.gz
Description: GNU Zip compressed data

Reply via email to