Hi Alan,

What version are you running? I just tried a simple test case with my development branch (basically the CVS version) and it's working for me.

I can send you my test if you'd like to tweak it a bit to see if you can reproduce the error you're getting.

--Keith

Alan Talanoa wrote:
Hey Keith,

Tried "big-decimal" and got the same result. On a whim I also tried 
java.lang.String but got a mapping error(as one would expect).

Any other ideas?

-----Original Message-----
From: Keith Visco [mailto:[EMAIL PROTECTED]
Sent: Monday, February 28, 2005 2:34 PM
To: [email protected]
Subject: Re: [castor-user] XML - Illegal Text data found as child of:




Hi Alan,

Does it make a difference if you change your mapping to:

<field name="..." type="big-decimal">
   ...
</field>

We have a built-in mapping for BigDecimal, specifying java.math.BigDecimal or just "big-decimal" should work the same, but I'm curious to know if it makes a difference.

--Keith

Alan Talanoa wrote:

Sent this out a few weeks back, im hoping this might catch someones eye this 
time around.

I get the following error when calling unmarshall. The Amount element is mapped to a 
BigDecimal value. Im not sure why this would cause a problem? The string value of 
"-1000" is handled by the BigDecimal string ctor.. Any ideas?

Illegal Text data found as child of: Amount
 value: "-1000"{file: [not available]; line: 2; column: 90}


My mapping file looks like this:

        <class name="Payment">
                <map-to xml="Payment"/>
                <field name="amount" type="java.math.BigDecimal">
                        <bind-xml name="Amount" node="element"/>
        </class>

And the XML is:
<Payments>
<Payment>
<Amount>-1000</Amount>      
</Payment>


------------------------------------------------------------------------

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




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




------------------------------------------------------------------------

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



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

Reply via email to