Thank you for your answer!
Where shall I post a suggestion?
I think it would be interesting that we could map XML like:

<node attr1="val1" attr2="val2" attr3="val3" attr4="val4" ... />

To an Hashmap where the keys would be the name of the attribute and
the attribute's values the values associated to the keys of the
hashmap.

Don't know if this is the right place for suggestions, if not I would
appreciate if someone tell me where to forward this idea.
I feel sorry I can't use Castor :(, everything was working so nice
till this limitation.

Best regards,
Daniel Garrido

On Fri, Apr 25, 2008 at 9:05 AM, Werner Guttmann
<[EMAIL PROTECTED]> wrote:
> Daniel,
>
>
>
>  Daniel Garrido wrote:
>  > Hello Castor community!
>  >
>  >  Is it possible to do the following:
>  >
>  >  Imagine I have the following XML, that I wish to unmarshall:
>  >
>  >  <component id="scanner" name="Scanner">
>  >         <model id="1" name="Foo" forecastMaintHours="80"
>  >  hourPrice="90" partsPrice="2800" />
>  >         <model id="2" name="Bar" forecastMaintHours="150"
>  >  hourPrice="90" partsPrice="14000"/>
>  >  </component>
>  >
>  >  I have a component class:
>  >
>  >  public class Component {
>  >
>  >         private String id;
>  >         private String name;
>  >         private List<Model> models;
>  >
>  >  ...
>  >  }
>  >
>  >  A model class:
>  >
>  >  public class Model {
>  >
>  >         private String id;
>  >         private List<ModelAttribute> attributes;
>  >
>  >  ...}
>  >
>  >  and finally a ModelAttribute class (basically it's purpose it to be an 
> hashmap:
>  >
>  >  public class ModelAttribute {
>  >
>  >         public String name;
>  >         public String value;
>  >  ...}
>  >
>  >  Now my question is, how can I map a custom name of a model attribute
>  >  to the ModelAttribute.name and its value to ModelAttribute.value?
>  This - to my knowledge - is not supported with Castor.
>
>  >
>  >  Best regards,
>  >  Daniel Garrido
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe from this list, please visit:
>  >
>  >     http://xircles.codehaus.org/manage_email
>  >
>  >
>  >
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to