I may be way off here, but the XML pretty print shouldn't have done that.
The "pretty print" version you pasted is not the same content, it contains a
newline (which may be \n or \r\n, etc) and some number of whitespace
characters (spaces or tabs) before the date string.
Sounds to me like JAXB is behaving correctly, in that it is an invalid date
string in the form (represented by regex) "\n\s*(.*)" where (.*) is the date
string
Alex Sherwin
alex.sherwin_at_acadiasoft.com
-----Original Message-----
From: budcurtis [mailto:bud.curtis_at_gmail.com]
Sent: Monday, November 17, 2008 12:50 PM
To: users_at_jaxb.dev.java.net
Subject: Unmarshalled Date Dropped from JAXB Object
I discovered in the standard JAXB unmarshaller that it would drop the tag
and
value if the date was presented in the inbound xml text as:
<ns3:LAST_MODIFICATION_DATE>
2008-11-13T20:46:36
</ns3:LAST_MODIFICATION_DATE>
The LAST_MODIFICATION_DATE JAXB generated method would return a null when
the input xml string contained the above representation of the date.
However, if the date was presented as one string:
<ns3:LAST_MODIFICATION_DATE>2008-11-13T20:46:36</ns3:LAST_MODIFICATION_DATE>
the JAXB unmarshaller would process it correctly. The resultant JAXB
object's LAST_MODIFICATION_DATE generated method would return the date
correctly.
How can I avoid this situation?
This came about because the marshalled XML was run through an XML pretty
print before sending it on to the receiving process. There was not one
warning when the string was unmarshalled, and it concerns me that other data
may be dropped due to presentation.
--
View this message in context:
http://www.nabble.com/Unmarshalled-Date-Dropped-from-JAXB-Object-tp20544417p
20544417.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net