Hi all,

My first post...

I has a Person class that has a map of postalAddresses. Each postal address has a key of 'type'. I'd like to marshall the addresses into a form where hte key was an attribute and the value was output as <address>:

<person>
     <address type="primary">
          <street>12424 lane lane</street>
           <state>MI</state>
           <postalCode>12421</postalCode>
           <city>Bobville</city>
           <country>US</country>
     </address>
     <address type="secondary">
      ....
     </address>
</person>

Right now, I can only get the mapping output that the default MappingItem class sets which is
<address>
       <key>Primary</key>
       <value>
           <street>12424 lane lane</street>
           <state>MI</state>
           <postalCode>12421</postalCode>
           <city>Bobville</city>
           <country>US</country>
       </value>
</address>

Any help is greatly appreciated.

This is what I currently have for my mapping below:
<class cst:name="edu.umich.med.cacr.hb.Person">
<field cst:name="postalAddresses" cst:type="edu.umich.med.cacr.hb.PostalAddress" collection="map">
      <bind-xml name="address" node="element" />
   </field>
</class>

<class cst:name="edu.umich.med.cacr.hb.PostalAddress">
   <field cst:name="streetAddressExt" cst:type="java.lang.String">
     <bind-xml name="streetExt" node="element" />
   </field>
   <field cst:name="streetAddress" cst:type="java.lang.String">
     <bind-xml name="street" node="element" />
   </field>
   <field cst:name="state" cst:type="java.lang.String">
     <bind-xml name="state" node="element" />
   </field>
   <field cst:name="postalCode" cst:type="java.lang.String">
     <bind-xml name="postalCode" node="element" />
   </field>
   <field cst:name="city" cst:type="java.lang.String">
     <bind-xml name="city" node="element" />
   </field>
   <field cst:name="country" cst:type="java.lang.String">
     <bind-xml name="country" node="element" />
   </field>
 </class>

Thanks,
Adam Kramer


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

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

Reply via email to