On 19 May 2004, at 06:03, Simon Kitching wrote:
On Wed, 2004-05-19 at 16:43, Bill Keese wrote:Thanks Simon!
All the existing Digester object creation options
(ObjectCreateRule, FactoryCreateRule) create the target object when the
opening xml tag is found.
I see. In that case, I need to create the Text object when the <text>
tag is encountered. The question is, how do I save the information that
appears before the <text> tag?
Yes, that's exactly the problem.
this is the kind of thing that the newer betwixt reading stuff (based on digester) does. the idea is that you push some temporary holder onto a processing stack (probably a list of some kind). when you reach the text tag, you use all the information accumulated on the processing stack to call whatever method you need (probably a constructor) then pop the temporary object from the processing stack. providing that the result is pushed onto the main object stack before the end tag is reach then the rest of the digester stuff should work ok (but remember to clean up the object by popping it from the stack at the end of end).
i suppose that it might be nice to have a digester rule that'd do this kind of thing but it isn't an itch for me at the moment and i don't seem to find much coding time these days :(
- robert
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
