commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <>
Subject Re: [Digester] Supporting mixed content
Date Sat, 05 Jan 2002 13:50:57 GMT
hi scott

i'm always pretty reluctant about changes to the basic Rule interface.

i think that there might be some other ways around this problem (but i'll 
need some thinking time) so maybe it'd be a good idea to hold off changing 
the interface for a little while.

- robert

On Friday, January 4, 2002, at 01:37 AM, Scott Sanders wrote:

> Hi all,
> I am trying to use Digester in a situation where some elements have
> mixed content.  For example:
> <tag name="text">Beginning effective <tag
> name="variableRef">EffectiveDate</tag>, the new policy will be in
> effect.</tag>
> So, currently Digester just appends the characters() method to the body
> text and then uses it at the endElement() method.  The problem is that I
> need the "Beginning effective " and the ", the new policy..." are
> actually two specifically different calls to some method, like
> addNode().  I know it sounds a little like DOM, but that is what I need
> at the moment.
> So, how do I accomplish this?  I propose changing the characters()
> method to call rules bodyText() method.  To prevent breakage, then I
> need the default Rule class to append these together and then use it.
> To access this functionality, a match rule would be something like
> "tag/text()" (ala Xpath)
> Any other ideas?  I do not want to break backward compatibility (or do
> we to break compatibility, support more, and then release as 2.0?), but
> I think that this is necessary to expand the flexibility of Digester.  I
> will soon need to expose attributes, as I am working on a more complete
> Xpath implementation.  That way we can also do something like
> "tag/@name" (the name attribute of the tag element).
> As far as I can see, Digester is being used for simple configuration,
> but stuff like documents that contain mixed content have an impossible
> time right now, and I really do not want to have to use DOM to do this.
> FYI, as a random thought, Digester could not actually be used to create
> a DOM right now, because of this body text issue.
> Scott
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message