commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcos Truchado Martín <marcos.truchado.mar...@hp.com>
Subject betwixt and mixed collections
Date Thu, 23 Mar 2006 11:21:31 GMT
Hi all, I´m having a problem trying to parse mixed collections. This is 
what I obtaint if I parse my bean to a XML file:

<?xml version='1.0' encoding="ISO-8859-1"?>
  <container>
    <element>
      <atr1>atr1</atr1>
      <atr2>atr2</atr2>
    </element>
    <element>
      <atr21>atr21</atr21>
      <otherelement>otherelemt1</otherelement>
      <otherelement>otherelemt2</otherelement>
      <otherelement>otherelemt3</otherelement>
      <otherelement>otherelemt4</otherelement>
    </element>
  </container>

This is correct and it´s the result I´m expecting. The problem comes 
when I try to parse this XML into a bean. Betwixt seems not to recognice 
the type of the elements under the Vector and it create instances of 
Object instead the right ones. If I parse the above XML into a bean and 
then into a XML again I obtaint:

<?xml version='1.0' encoding="ISO-8859-1"?>
  <container>
    <element/>
    <element/>
  </container>

Every element is parsed as Object. The source code I´m using (including 
the dot betwixt files) is attached to this mail.

Note that if I turn on MapIDs property under the binding configuration 
the result is correct but I get some id="number" attributes that must 
not be there for my needs.

Thanks in advance.

Mime
View raw message