Hi Jitesh,

There's at least one bug related to the use of the 'location' attribute
registered with Castor at http://jira.codehaus.org/browse/CASTOR. Please
feel free to add your samples to the issue in question.

Werner

> -----Original Message-----
> From: Kalyani Jitesh [mailto:[EMAIL PROTECTED] 
> Sent: Montag, 26. September 2005 12:26
> To: [email protected]
> Subject: [castor-user] [XML] mapping : location attribute
> 
> HI There,
> 
> I am using Catsor mapping.I am having problem with Catsor 
> mapping location attribute. I had this problem with Cator 0.9.7.
> And I have tried with Catsor 0.9.9, this version also have 
> same problem. Is this Castor bug, Or I have  to do something else.
> Can anybody help in this matter.
> 
> Thanks And Regards,
> JItesh
> 
> Original XML=>
> <order orderid="O-1">
>    <Items>
>      <Item itemid="I-2">
>        <Details desc="chocolate">
>          <Grade1 quantity="10" unitprice="28.5"/>
>          <Grade2 quantity="5" unitprice="20"/>
>        </Details>
>      </Item>
>      <Item itemid="I-1">
>        <Details desc="Stuffed Penguin">
>          <Grade1 quantity="20" unitprice="30"/>
>          <Grade2 quantity="3" unitprice="25"/>
>        </Details>
>      </Item>
>    </Items>
> </order>
> 
> Castor ouput after marshalling => Which is not correct.
> <?xml version="1.0" encoding="UTF-8"?>
> <Order orderid="O-1">
>     <Items>
>         <Item itemid="I-2">
>             <Details desc="chocolate"/>
>             <Details>
>                 <Grade1 quantity="10" unitprice="28.5"/>
>             </Details>
>             <Details>
>                 <Grade2 quantity="5" unitprice="20.0"/>
>             </Details>
>         </Item>
>         <Item itemid="I-1">
>             <Details desc="Stuffed Penguin"/>
>             <Details>
>                 <Grade1 quantity="20" unitprice="30.0"/>
>             </Details>
>             <Details>
>                 <Grade2 quantity="3" unitprice="25.0"/>
>             </Details>
>         </Item>
>     </Items>
> </Order>
> 
> Mapping File=>
> <mapping>
>     <class name="Order">
>      <map-to xml="Order" />
> 
>      <field name="orderid" type="string">
>        <bind-xml name="orderid" node="attribute" />
>      </field>
> 
>   <field name="itemsid" type="string">
>        <bind-xml name="itemsid" node="attribute" location="Items"/>
>     </field>
> 
>      <field name="Items" collection="map" get-method="getItems"
>          set-method="addItem" type="Item">
>        <bind-xml name="Item" location="Items" />
>      </field>
>    </class>
> 
>    <class name="Item">
>    <field name="itemid" type="string" direct="true">
>     <bind-xml name="itemid" node="attribute"/>
>    </field>
> 
>    <field name="description" type="string" direct="true">
>     <bind-xml name="desc" node="attribute" location="Details"/>
>    </field>
> 
>   <field name="quantity1" type="integer" direct="true">
>     <bind-xml name="quantity" node="attribute" 
> location="Details/Grade1"/>
>   </field>
> 
>   <field name="unitPrice1" type="float" direct="true">
>      <bind-xml name="unitprice" node="attribute" 
> location="Details/Grade1"/>
>    </field>
> 
>    <field name="quantity2" type="integer" direct="true">
>        <bind-xml name="quantity" node="attribute" 
> location="Details/Grade2"/>
>      </field>
> 
>      <field name="unitPrice2" type="float" direct="true">
>        <bind-xml name="unitprice" node="attribute" 
> location="Details/Grade2"/>
>      </field>
>    </class>
> </mapping>
> 
> Order.java=>
> public class Order {
>      private String orderid;
>      private String itemsid;
> 
>      private Map Items = new HashMap();
> 
>      public void setOrderid( String id ) { orderid = id; }
>      public String getOrderid() { return orderid; }
> 
>   public void setItemsid( String id ) { itemsid = id; }
>      public String getItemsid() { return itemsid; }
> 
>      public void setItems( Map items ) { Items = items; }
>   public Map getItems() { return Items; }
> 
>      public void addItem( Item item ) {
>          Items.put( item.itemid, item );
>      }
> }
> 
> Item.java =>
> public class Item {
> 
>  public String itemid;
>     public int quantity1;
>     public float unitPrice1;
> 
>  public int quantity2;
>     public float unitPrice2;
> 
>     public String description;
> }
> 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please send an 
> empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 
> 
> 

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to