Hello,

I have the following XML construction:

   <customlists>
        <ipblacklist>
            <address enabled="false">127.0.0.1</address>
        </ipblacklist>
   </customlists>

I have specified this in the following way in my XSD:

   <xsd:element minOccurs="1" name="customlists">
        <xsd:complexType>
         <xsd:all>
            <xsd:element name="ipblacklist" minOccurs="1" maxOccurs="1">
               <xsd:complexType>
                  <xsd:all>
                     <xsd:element name="address" maxOccurs="1"
type="addresstype"/>
                  </xsd:all>
               </xsd:complexType>
            </xsd:element>
         </xsd:all>
      </xsd:complexType>
   </xsd:element>

   <xsd:complexType name="addresstype">
      <xsd:sequence />
        <xsd:attribute name="enabled" type="xsd:boolean" />
   </xsd:complexType>   


Castor successfully created classes for this construction. When I try to
unmarshall the specfied XML though, I get the following error:

Illegal Text data found as child of: address
  value: "127.0.0.1"

It seems that the problem lays in the fact that you can't have both
attributes and child text at the same time. 

So correct: <address enabled="false" ip="127.0.0.1"/> would be ok, and so
would <address enabled="false"><ip>127.0.0.1</ip></address>
But incorrect: <address enabled="false">127.0.0.1</address>

This seems like very normal XML notation. How do I fix this? Should I adapt
the descriptors? And if so, in what way?

Best regards,
Niels



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to