You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Arunkumar Dubagunta <Ad...@1800FLOWERS.com> on 2007/02/14 01:19:28 UTC

Help me to get proper value in generated XML fpr xs:gYear data type

Hi,

  I'm using XMLBeans to generate an XML for given XSD file. 

  The XSD has a field with data type XS:gYear.

  The setter method has a convenience data type Calendar and I'm setting the Calendar object.

  Calendar calendar = Calendar.getInstance(); 
 calendar.set(Calendar.YEAR,2008);

  dateOfBirthType.setBirthYear(calendar);

  The resultant XML is coming in the following 

 <DateOfBirth>
	<BirthYear>2008-05:00</BirthYear>
 </DateOfBirth>

  I'm expecting the resultant XML to be 

<DateOfBirth>
	<BirthYear>2008</BirthYear>
 </DateOfBirth>

 Can somebody help me to oercome this issue?

Thanks,
Arun Kumar Dubagunta




-----------------------------------------
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or
entity to which it is addressed. If the reader of this e-mail is
not the intended recipient or his or her authorized agent, the
reader is hereby notified that any dissemination, distribution or
copying of this e-mail is prohibited. If you have received this
e-mail in error, please notify the sender by replying to this
message and delete this e-mail immediately.

RE: Help me to get proper value in generated XML fpr xs:gYear data type

Posted by Wing Yew Poon <wp...@bea.com>.
Arun Kumar,
try doing the following instead:

    Calendar calendar = Calendar.getInstance();
    calendar.clear(); // this clears the fields, including
Calendar.ZONE_OFFSET
    calendar.set(Calendar.YEAR, 2008);
    dateOfBirthType.setBirthYear(calendar);

- Wing Yew

________________________________

From: Arunkumar Dubagunta [mailto:Adubagunta@1800FLOWERS.com] 
Sent: Tuesday, February 13, 2007 4:19 PM
To: user@xmlbeans.apache.org
Subject: Help me to get proper value in generated XML fpr xs:gYear data
type




Hi,

  I'm using XMLBeans to generate an XML for given XSD file. 

  The XSD has a field with data type XS:gYear.

  The setter method has a convenience data type Calendar and I'm setting
the Calendar object.

  Calendar calendar = Calendar.getInstance(); 

 calendar.set(Calendar.YEAR,2008);

  dateOfBirthType.setBirthYear(calendar);

  The resultant XML is coming in the following 

 <DateOfBirth>

        <BirthYear>2008-05:00</BirthYear>

 </DateOfBirth>

  I'm expecting the resultant XML to be 

<DateOfBirth>

        <BirthYear>2008</BirthYear>

 </DateOfBirth>

 Can somebody help me to oercome this issue?

Thanks,

Arun Kumar Dubagunta

________________________________



This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or
entity to which it is addressed. If the reader of this e-mail is
not the intended recipient or his or her authorized agent, the
reader is hereby notified that any dissemination, distribution or
copying of this e-mail is prohibited. If you have received this
e-mail in error, please notify the sender by replying to this
message and delete this e-mail immediately.

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org