I tried to use directly the XmlGYear object, which also provided me the same 
result.

XmlGYear xmlGYear = XmlGYear.Factory.newInstance();
xmlGYear.setStringValue(Integer.toString(2008));
dateOfBirthType.setBirthYear(xmlGYear);
                                        
 I'm running out of idea, can somebody please help me.

Thanks,
Arun Kumar Dubagunta


> -----Original Message-----
> From: Arunkumar Dubagunta [SMTP:[EMAIL PROTECTED]
> Sent: Tuesday, February 13, 2007 7:19 PM
> To:   [email protected]
> 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.
> 

Reply via email to