Thomas,

what you are describing here is .. well, quite odd to me, as that's one of Castor's standard features at unmarshalling.

Can you please raise a new issue at

http://jira.codehaus.org/browse/CASTOR

and attach both a XML schema as well as a XML document that should unmashal successfully. Have a look at the guidelines in the HOW-TO section as well.

Regards
Werner

Thomas Papendieck wrote:
Hello,

I generated code from an XSD like this:
        <element name="theName">
                <complexType>
                        <sequence>
                                <element name="innerElement" minOccurs="0"
                                        maxOccurs="unbounded" >
                                        <complexType />
                                </element>
                        </sequence>
                        <attribute name="AttName" type="string"  use="required" 
/>
                        <attribute name="AttType" type="string" />
                </complexType>
        </element>

The generated code looks good and provides accessors to the attributes.

I tried to unmarshall a XML like this:

<theElement AttName="anElementName" AttType="anElementType">
        <innerElement/>
</theElement>
I get an Exception:
 org.exolab.castor.xml.MarshalException: theElement is missing required 
attribute: AttName

And any attribute accessor returnes NULL.

How can I force Castor to unmarshal Attributes?

--
OPITZ CONSULTING Bad Homburg GmbH
Thomas Papendieck Dipl.-Ing./Dipl.-Inf. Consultant
Kaiser-Friedrich-Promenade 95 - D-61348 Bad Homburg
Phone (Fax): +49 6172 / 66260-1523 (-4500) - Mobile: +49 179 1483 003
http://www.opitz-consulting.de
Geschäftsführer: Bernhard Opitz, Dirk Faulhaber
HRB-Nr. 7100 Amtsgericht Bad Homburg


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

    http://xircles.codehaus.org/manage_email





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

   http://xircles.codehaus.org/manage_email

Reply via email to