users@jaxb.java.net

Strange error

From: Joan Antoni Farre <joan.antoni.farre_at_barcelona.eds.es>
Date: Thu, 29 Jan 2004 16:38:52 +0100

Hi!
I have an XML Schema with a piece like this:

      <xsd:complexType name="AComplexType">
            <xsd:sequence>
                  <xsd:element ref="ANOTHER_TYPE" minOccurs="0"
maxOccurs="1"></xsd:element>
                  <xsd:element name="MY_NAME" minOccurs="1"
maxOccurs="unbounded">
                        <xsd:complexType>
                              <xsd:sequence>
                                    <xsd:element
ref="REFERENCED"></xsd:element>
                              </xsd:sequence>
                              <xsd:attribute
name="anotherName"></xsd:attribute>
                        </xsd:complexType>
                        <xsd:key name="stillAnotherName">
                              <xsd:selector xpath="."></xsd:selector>
                              <xsd:field xpath="@anotherName"></xsd:field>
                        </xsd:key>
                  </xsd:element>
            </xsd:sequence>
      </xsd:complexType>


      <xsd:complexType name="AnotherComplexType">
            <xsd:complexContent>
                  <xsd:restriction base="aComplexType">
                        <xsd:sequence>
                              <xsd:element ref="ANOTHER_TYPE" minOccurs="0"
maxOccurs="1"></xsd:element>
                              <xsd:element name="MY_NAME" minOccurs="2"
maxOccurs="2">
                                    <xsd:complexType>
                                          <xsd:sequence>
                                                <xsd:element
ref="REFERENCED"></xsd:element>
                                          </xsd:sequence>
                                          <xsd:attribute name="anotherName"
use="required">
                                                <xsd:simpleType>
                                                      <xsd:restriction
base="xsd:string">

<xsd:enumeration value="a"></xsd:enumeration>

<xsd:enumeration value="b"></xsd:enumeration>
                                                      </xsd:restriction>
                                                </xsd:simpleType>
                                          </xsd:attribute>
                                    </xsd:complexType>
                                    <xsd:key name="aDifferentName">
                                          <xsd:selector
xpath="."></xsd:selector>
                                          <xsd:field
xpath="@anotherName"></xsd:field>
                                    </xsd:key>
                              </xsd:element>
                        </xsd:sequence>
                  </xsd:restriction>
            </xsd:complexContent>
      </xsd:complexType>

It's considered valid by WebSphere, but I get this error when compiling it
with xjc from JWSDP 1.3:

[ERROR] rcase-Recurse.2: There is not a complete functional mapping between the
particles.
  line 126 of myschema.xsd

[ERROR] derivation-ok-restriction.5.3.2: Error for type 'AnotherComplexType'.
 The particle of the type is not a valid restriction of the particle of the base
.
  line 126 of myschema.xsd

Failed to parse a schema.

May be this kind of restriction isn't supported by JAXB?
Any help will be appreciated.
Thank you,

Juan



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