You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by ra...@dreamthought.com on 2005/04/18 16:25:45 UTC

Re: AW: DIGESTER/XML-RULES: Accessing attributes in a call-method-rule

Hi CK,
> -----Ursprüngliche Nachricht-----

> Hallo Raf,
>
> why don't you use a factory create rule in combination with your own
> abstract object creation factory implementation? This works fine with the
> XML rules and you have complete control over all attributes...
>
> When <something> is parsed it permits you to access its attributes via
> a_attributes.getQName(i) and
> a_attributes.getName(i), thus you are able to call BeanUtils.setProperty()
> or PropertyUtils.setProperty()
> to populate the properties of your newly created instance...
>
Thanks for the tip.
What I've currently ended up doing is using <INCLUDE class='bar.foo'/>
Where bar.foo extends DigesterRulesSource and adds bar.rule for all
"something" patterns.  I then use bar.rule to step in and access my
sax.Attributes and then manually peek and add my new instance to the
object on the stack.

It feels very dirty though. :)

R.





---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org