it appears that with castor 0.9.5.3 the following happens:
a) start with an object O which contains a String field X with value "Cheech & Chong go to school"
b) marshal the object to xml and get a String containing ….>Cheech & Chong go to school<….
c) unmarshal the xml to an O, X contains the value "Cheech&Chong go to school" !!! no spaces around &
with 0.9.5.2 the spaces were retained.
now I can turn off this space removal behavior with unmarshaller.setWhitespacePreserve(true).
but this seem a little non-intuitive, I mean, castor created the xml why do I have to tell the unmarshaller how to unmarshal it?
Since castor is creating the xml … I have no obvious way to add xml:space attributes. or do I?
My basic question is, is this behavior correct? i.e., that internal whitespace surrounding entities is stripped unless whitespace preserve is set?
I could see leading and trailing whitespace being stripped by default.
I will admit I am not fully up-to-speed on the various xml specifications - but I would have expected marshall/unmarshal to be an identity mapping by default.
that is, if ObjectIn => MARSHALLER => String => UNMARSHALLER => ObjectOut
then ObjectIn is identical to ObjectOut (for each field z in ObjectIn, ObjectIn.z equals ObjectOut.z)
Jay Goldman
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
