Hi, 
I'm having an issue generating proper Java code for a 3rd party schema.
I'm using Castor 1.1.2.1 with the castor-maven-plugin 1.0.  I can
generate all of the code fine, but when I try to extract an object from
a sample data feed, I get the exception:

java.io.IOException: Illegal Text data found as child of: simpleAltitude
  value: "060"
        at parser.MyUnmarshaller.unmarshalOutput(MyUnmarshaller.java:36)
        at
parser.MyUnmarshallerTest.testReadOutput(MyUnmarshallerTest.java:44)
        ...

One instance of this element in the data feed looks like so:

<nxce:assignedAltitude>
  <nxce:simpleAltitude>160</nxce:simpleAltitude>
</nxce:assignedAltitude>

The definition for the element "simpleAltitude" is shown below:

<xsd:element name="simpleAltitude">
  <xsd:complexType>
    <xsd:simpleContent>
      <xsd:extension base="simpleAltitudeType">
        <xsd:attribute name="above" type="xsd:boolean">
        </xsd:attribute>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
</xsd:element>

Which extends from the simple type simpleAltitudeType:

<xsd:simpleType name="simpleAltitudeType">
  <xsd:restriction base="xsd:string">
    <xsd:pattern value="[0-9]{0,3}[C,T]{0,1}"/>
  </xsd:restriction>
</xsd:simpleType>

When I generated the code, the SimpleAltitude class was only given two
properties:

boolean _above;
boolean _has_above;

These are both related to the "above" attribute in the schema definition
for "simpleAltitude".  The class does not, however, have a property to
hold the text data for the "simpleAltitude" element (i.e. "160").  This
seems to be the cause of the exception.  

Is there a configuration option I can set to generate this property?  If
not, is there a way to write a custom binding for this particular
element, such that I can force the creation of a property to hold the
text data?

Thanks in advance for the help!

Regards,
Nate


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to