Please disregard the previous email, I'm sorry.  Sometimes I just don't
think well towards the end of the day!

Sorry,

Matt :)

-----Original Message-----
From: Siegel, Matthew [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 20, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Problem with Attribute and Text in same tag


Hi all,

I am using Castor version 0.9.3.21.  I am having a problem unmarshalling a
very very simple xml file.

Here's the xml file:

<file type="gif">
image_file.gif
</file>

Here's my mapping file:

<class name="File">
    <field name="Text" type="java.lang.String">
        <bind-xml name="file" node="element"/>
    </field>

    <field name="Type" type="java.lang.String">
        <bind-xml name="type" node="attribute"/>
    </field>
</class>

Here's the exception that I am getting:

org.xml.sax.SAXException: Illegal Text data found as child of: file
  value: "
image_file.gif
"
        at org.exolab.castor.xml.UnmarshalHandler.endElement(Unknown Source)
        at
org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1392)
        at
org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator
.java:1550)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScanner.java:1149)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
        at org.exolab.castor.xml.Unmarshaller.unmarshal(Unknown Source)

I would think that I would be allowed to put an attribute and body in the
same tag.

Any help would be appreciated!

Thanks,

Matt Siegel
Software Engineer
Solers, Inc.
http://www.solers.com

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

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

Reply via email to