Hi there,
I am seeing different behavior while marshalling the following
document. We still use castor-0.92.jar for
reasons I cannot explain. We do not use descriptors because we had
problems with unmarshalling dates at that time and not using descriptors
was a good work-around.
I have the following java code:
CurrentEventInfo is a castor generated object.
CurrentEventInfo cInfo = eventPayload.getCurrentEventInfo();
Marshaller marshObj1 = new Marshaller(writer);
marshObj1.marshal(cInfo,writer);
Gazoo.debug("CINFO in CalUtil" + writer.toString());
In one case, I get the following (please look out for event-invitees
element in both cases)
<?xml version="1.0"?>
<current-event-info customer-id="0" process-state="-9" event-id="79003"
recurring-event="false" all-day-event="false"
event-invitees-count="1"><subject>Restaurant
Reservation</subject><event-invitees>[EMAIL PROTECTED]</event-invitee
s><event-end-date>2001-08-24T11:15:00</event-end-date><event-location>Re
staurant Location To Be Determined -
Sunnyvale,CA</event-location><event-start-date>2001-08-24T10:15:00</even
t-start-date><event-time-zone>PST</event-time-zone><organizer-first-name
>Roman</organizer-first-name><organizer-last-name>Bukary</organizer-last
-name><recurring-time-period></recurring-time-period></current-event-inf
o>
While in another scenario,
The only difference in scenarios are, there are some other objects
marshalled before it marshalls my object. The same piece of code
marshals it differently. The Difference is xmlns:xsi and xsi:type are
not being printed out. What do I need to ensure, so that I get the same
behavior. What am I missing
<?xml version="1.0"?>
<current-event-info event-id="75803" customer-id="0"
all-day-event="false" event-invitees-count="1" process-state="0"
recurring-event="true"><subject>TEst Subject</subject><event-invitees
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:type="java:java.lang.String">[EMAIL PROTECTED]</event-invitees><e
vent-end-date>1900-01-01T00:00:00</event-end-date><event-location>Test
Location</event-location><event-start-date>2001-08-22T21:11:04</event-st
art-date><event-time-zone>PST</event-time-zone><organizer-first-name>Rom
an</organizer-first-name><organizer-last-name>Bukary</organizer-last-nam
e><recurring-time-period>Repeats Every
day</recurring-time-period></current-event-info>
The reason why this is important is, if xsi:type is not prefixed , when
unmarshalling this document, I get an error ILLEGAL TEXT DATA FOUND as
child of element <event-invitees>
Please help me...
Thanks
Pramod
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev