users@jaxb.java.net

Re: XJC throwing a ClassCastException when parsing schema

From: Adam Cohen-Rose <java.net_at_cohen-rose.org>
Date: Tue, 11 Nov 2003 18:16:42 -0000 (GMT)

We've narrowed the problem down to the following schema fragment.

It's a subtle error that isn't picked up by most validators - in fact it
might even be a semantic error rather than a syntactic one.

Perhaps the error condition could be a little more revealing...?

Best wishes,

Adam & James

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified" attributeFormDefault="unqualified">
  <xsd:element name="dodgyElement" type="dodgyType"/>
  <xsd:complexType name="dodgyType">
    <xsd:complexContent>
      <xsd:extension base="xsd:string">
        <xsd:sequence>
          <xsd:element name="subelement" type="xsd:string" minOccurs="0"
maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="attribute1" type="xsd:string"/>
        <xsd:attribute name="attribute2" type="xsd:string"/>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>


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