Thanks very much Madhu. I've much to learn.

On Thu, Aug 27, 2009 at 5:39 PM, madhu rao <rollma...@gmail.com> wrote:

> I have added ordered="false" to the mapping element with name="style"
>
> *<mapping class="hoolam.Style" name="style" ordered="false">*
>
> Let me know if this works fine
>
> Thanks
> Madhu
>
>
>
>
> On Thu, Aug 27, 2009 at 12:27 PM, Hoolam Woon <hoolam.w...@binu.com>wrote:
>
>> The binding is as follow:
>>
>> <binding name="binding" package="hoolam">
>>   <mapping class="hoolam.Style" name="style">
>>     <structure type="hoolam.Color" get-method="getColor"
>> set-method="setColor" usage="optional"/>
>>     <structure type="hoolam.Font" get-method="getFont"
>> set-method="setFont" usage="optional"/>
>>     <value style="attribute" name="name" get-method="getName"
>> set-method="setName"/>
>>   </mapping>
>>   <mapping class="hoolam.Font" name="font">
>>     <value style="attribute" name="face" get-method="getFace"
>> set-method="setFace" usage="optional"/>
>>   </mapping>
>>   <mapping class="hoolam.Color" name="color">
>>     <value style="attribute" name="value" get-method="getValue"
>> set-method="setValue"/>
>>   </mapping>
>> </binding>
>>
>> Thanks,
>> Hoolam
>>
>>
>> On Thu, Aug 27, 2009 at 4:48 PM, madhu rao <rollma...@gmail.com> wrote:
>>
>>> Can you attach the jibx binding used for this ?
>>>
>>> Thanks
>>> Madhu
>>>
>>> On Thu, Aug 27, 2009 at 11:05 AM, Hoolam Woon <hoolam.w...@binu.com>wrote:
>>>
>>>> Hi all,
>>>>
>>>> I get a JiBXException when I tried to unmarshall the following very
>>>> simple XML document:
>>>>
>>>> <style name="header">
>>>> <font face="Arial"/>
>>>> <color value="#FFE9E9E9"/>
>>>> </style>
>>>>
>>>> However, if I swap the order of <font> and <color> (so that <color>
>>>> comes before <font>), then no exception is raised.
>>>>
>>>> The schema is as follow:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
>>>> elementFormDefault="qualified">
>>>>         <xs:element name="style">
>>>>                 <xs:complexType>
>>>>                         <xs:all>
>>>>                                 <xs:element ref="color" minOccurs="0"
>>>> maxOccurs="1" />
>>>>                                 <xs:element ref="font" minOccurs="0"
>>>> maxOccurs="1" />
>>>>                         </xs:all>
>>>>                         <xs:attribute name="name" use="required"
>>>> type="xs:string" />
>>>>                 </xs:complexType>
>>>>         </xs:element>
>>>>         <xs:element name="font">
>>>>                 <xs:complexType>
>>>>                         <xs:attribute name="face" use="optional"
>>>> type="xs:string" />
>>>>                 </xs:complexType>
>>>>         </xs:element>
>>>>         <xs:element name="color">
>>>>                 <xs:complexType>
>>>>                         <xs:attribute name="value" type="xs:string"
>>>> use="required" />
>>>>                 </xs:complexType>
>>>>         </xs:element>
>>>> </xs:schema>
>>>>
>>>> And the exception raised is as follow:
>>>>
>>>> runcust:
>>>>      [echo] Running the sample application...
>>>>      [java] Exception in thread "main" org.jibx.runtime.JiBXException:
>>>> Expected "style" end tag, found "color" start tag (line 3, col 27)
>>>>      [java]     at
>>>> org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(UnmarshallingContext.java:736)
>>>>      [java]     at hoolam.JiBX_bindingStyle_access.unmarshal()
>>>>      [java]     at
>>>> org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2762)
>>>>      [java]     at
>>>> org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2905)
>>>>      [java]     at hoolam.Test.main(Test.java:20)
>>>>      [java] Unmarshalling ABC1.padl
>>>>
>>>> It seems to me JiBX doesn't handle <xs:all> correctly, in that <xs:all>
>>>> describes an unordered group of elements but JiBX insists on the order as
>>>> elements appear in XSD.
>>>>
>>>> Can anyone help?
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>>>> 30-Day
>>>> trial. Simplify your report design, integration and deployment - and
>>>> focus on
>>>> what you do best, core application coding. Discover what's new with
>>>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>>>> _______________________________________________
>>>> jibx-users mailing list
>>>> jibx-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/jibx-users
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>>> 30-Day
>>> trial. Simplify your report design, integration and deployment - and
>>> focus on
>>> what you do best, core application coding. Discover what's new with
>>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>>> _______________________________________________
>>> jibx-users mailing list
>>> jibx-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jibx-users
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> 30-Day
>> trial. Simplify your report design, integration and deployment - and focus
>> on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> jibx-users mailing list
>> jibx-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jibx-users
>>
>>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to