commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "HernĂ¡n Seoane" <>
Subject Help with Digester xmlrules to create a complex object
Date Wed, 05 Jul 2006 22:29:24 GMT
Hello,  I'm having some trouble with Digester when trying to create a
"complex" object from the following xml:


My xmlrules are:

 <pattern value="Competition">
  <object-create-rule classname="Competition" />
  <call-method-rule pattern="CompetitionName"
methodname="setCompetitionName" paramcount="0" />
  <call-method-rule pattern="PrizeOnOffer" methodname="setPrizeOnOffer"
paramcount="0" />

  <object-create-rule classname="Contestant" />
  <call-method-rule pattern="WinnerFirstName" methodname="setFirstName"
paramcount="0" />
  <call-method-rule pattern="WinnerLastName" methodname="setLastName"
paramcount="0" />
  <call-method-rule pattern="WinnerTown" methodname="setTown" paramcount="0"
  <set-next-rule methodname="setWinner" paramtypes="Contestant" />

My Competition object has a Contestant attribute, and what I'm trying to do
is to set the Contestant to the Competition object, but it's not working, as
the information for both objects is at the same level in the DOM structure,
I'm receiving the following error:

*No such accessible method: setCompetitionName() on object:

The XML file I'm reading cannot be modified, so I cannot change the
structure to nest properties. Any ideas?
Thanks in advance,

Hernan Seoane

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message