commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance Semmens <lance.semm...@essential.com.au>
Subject RE: Digester beginner question
Date Tue, 26 Apr 2005 06:00:56 GMT
But simon's point of using getters() and setters() rather than direct field
mainipulation is still valid.
It's bad java practice to have fields accessible outside the class scope ...
i was just working with the example that was given.

-----Original Message-----
From: Simon Kitching [mailto:skitching@apache.org]
Sent: Tuesday, 26 April 2005 3:19 PM
To: Jakarta Commons Users List
Subject: RE: Digester beginner question
Importance: Low


On Tue, 2005-04-26 at 17:40 +1200, Simon Kitching wrote:
> Hi,
> 
> Yep, I pretty much agree with Lance.
> 
> Digester doesn't support xpath-like matching; it would be nice but is
> difficult and no-one has yet done so.
> 
> Processing xml like
>   <attribute name="id">some-value</attribute>
> is awkward because info on the target field ("id") is provided in a
> different callback from the data.
> 
> Lance's solution looks ok to me. It may not work right if the rule is
> associated with a wildcard pattern (eg "*/attribute") - if you need
> this, I would suggest replacing fieldName with a stack, or using the
> digester "named stacks" feature.

Hmm.. actually, for this rule, the content is always plain text by
definition, never nested data so I guess a simple field is ok in this
case, just as Lance had it.

Cheers,

Simon



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

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


Mime
View raw message