users@jaxb.java.net

jaxb can't handle this schema?

From: Philip, Tim <Tim_Philip_at_intuit.com>
Date: Wed, 24 Sep 2003 16:11:34 -0700

I have a rather complicated schema definition provided
by a 3rd party. I'm trying to use JAXB to help me
handle this information. It is dying while trying to
figure out how to handle this section of schema. I've
trimed down the schema a lot to remove clutter, this
is about as small as I can get it, and still have it
reproduce the problem.

Is there something inherently wrong with this schema?
Or have I hit some limitation in JAXB? XMLSpy thinks
the schema is fine ... which doesn't necessary mean
a lot. :)

Schema and errors follow ...


Thanks!
Tim.

----- Schema ---------

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<xsd:schema elementFormDefault="unqualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        
        <xsd:element name="Funk" type="FunkyList"/>

        <xsd:complexType name="FunkyList">
                <xsd:choice>
                        <xsd:sequence>
                                <xsd:choice>
                                        <xsd:sequence>
                                                <xsd:element
name="InstanceA" type="TypeA"/>
                                                <xsd:element
name="InstanceB" type="TypeB"/>
                                        </xsd:sequence>
                                        <xsd:sequence>
                                                <xsd:element
name="InstanceB" type="TypeB"/>
                                                <xsd:element
name="InstanceA" type="TypeA"/>
                                        </xsd:sequence>
                                </xsd:choice>
                        </xsd:sequence>
                        <xsd:sequence>
                                <xsd:choice>
                                        <xsd:element name="InstanceA"
type="TypeA"/>
                                        <xsd:element name="InstanceB"
type="TypeB"/>
                                </xsd:choice>
                                <xsd:choice>
                                        <xsd:element name="InstanceB"
type="TypeB"/>
                                        <xsd:element name="InstanceA"
type="TypeA"/>
                                </xsd:choice>
                        </xsd:sequence>
                </xsd:choice>
        </xsd:complexType>

        <xsd:complexType name="TypeA">
                <xsd:sequence>
                        <xsd:element name="A1" type="xsd:string"/>
                        <xsd:element name="A2" type="xsd:string"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:complexType name="TypeB">
                <xsd:sequence>
                        <xsd:element name="B1" type="xsd:string"/>
                        <xsd:element name="B2" type="xsd:string"/>
                </xsd:sequence>
        </xsd:complexType>

</xsd:schema>

----- Errors Generated ------

C:\jax>%JWSDP_HOME%\jaxb\bin\xjc.bat -nv -p problem problem2.xsd
parsing a schema...
[ERROR] A class/interface with the same name "problem.FunkyList.InstanceB"
is already in use.
  line 15 of problem2.xsd

[ERROR] (Relevant to above error) another one is generated from here.
  line 12 of problem2.xsd

[ERROR] A class/interface with the same name "problem.FunkyList.InstanceA"
is already in use.
  line 16 of problem2.xsd

[ERROR] (Relevant to above error) another one is generated from here.
  line 11 of problem2.xsd

[ERROR] A class/interface with the same name "problem.FunkyList.InstanceA"
is already in use.
  line 22 of problem2.xsd

[ERROR] (Relevant to above error) another one is generated from here.
  line 11 of problem2.xsd

[ERROR] A class/interface with the same name "problem.FunkyList.InstanceB"
is already in use.
  line 23 of problem2.xsd

[ERROR] (Relevant to above error) another one is generated from here.
  line 12 of problem2.xsd

[ERROR] A class/interface with the same name "problem.FunkyList.InstanceB"
is already in use.
  line 26 of problem2.xsd

[ERROR] (Relevant to above error) another one is generated from here.
  line 12 of problem2.xsd

[ERROR] A class/interface with the same name "problem.FunkyList.InstanceA"
is already in use.
  line 27 of problem2.xsd

[ERROR] (Relevant to above error) another one is generated from here.
  line 11 of problem2.xsd

Failed to parse a schema.
C:\jax>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net