Brian, 
The new xml Works fine... :D
Thanks!

-----Mensaje original-----
De: b p [mailto:[EMAIL PROTECTED] 
Enviado el: Mi�rcoles, 01 de Septiembre de 2004 07:36 p.m.
Para: Jakarta Commons Users List
Asunto: RE: betwix help needed, can't make run a very simple app!

I think you are missing some elements in your xml.  Try reading this in:
 
<races>
  <races>
      <race id="1" name="Federal" />
      <race id="2" name="Lizard" />
      <race id="10" name="Rebel" />
  </races>
</races>
 
The reason being that the Races bean maps to xml element races.  The Races bean has a 
property races (thus the nested "races" element in the XML).  The property "races" is 
the array which consists of multiple Race beans..

-Brian

Esteban Lorenzano <[EMAIL PROTECTED]> wrote:
Brian,
thanks for de answer... but the problem is still there :(
The "Races" bean is correct (btw, I also did some tests changing Collection types, and 
nothing). 
The "Races" bean definition is here (as I said, it is a very simple bean):

public class Races {
private ArrayList races = new ArrayList(11);

public Races() { 
}

public ArrayList getRaces() {
return races;
}

public void addRace(Race race) {
races.add(race);
}
}

any idea?
Thanks


-----Mensaje original-----
De: b p [mailto:[EMAIL PROTECTED] 
Enviado el: Mi�rcoles, 01 de Septiembre de 2004 04:37 p.m.
Para: Jakarta Commons Users List
Asunto: Re: betwix help needed, can't make run a very simple app!

Does your Races bean have an adder of the correct form? Should follow the pattern:

public class SomeBean {
public getFoo*();
public void addFoo( foo);
}

See the "Using Adder Methods For Composite Properties" section at 
http://jakarta.apache.org/commons/betwixt/guide/binding.html for a full description.

-Brian

Esteban Lorenzano wrote:
Hi all, 
Please, I need some help here. I have an application, and I want to
migrate all the configuration to xml, and parse with betwixt, but I
can't make work a very-very simple problem:
The xml to parse is: 







The code to parse is the following:

BeanReader beanReader = new BeanReader();
beanReader.registerBeanClass("races", Races.class);
beanReader.registerBeanClass("races/race", Race.class);
Races races = (Races)
beanReader.parse(FileProvider.getSystemFile(fileName).getInputStream());

The parsing is successful, and a "Races" object is created, but the
collection with races is empty :-(
What can be happening?

Thanks in advance,
Esteban

Pd: sorry if my English is not cool... I'm not a speaker


---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


                
---------------------------------
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to