From: "Leo Simons" <[EMAIL PROTECTED]> > What we need is a generic delegating sax parser with dynamic element > handlers passed in at runtime. Solves all your problems =) > > The idea is that you add a layer on top of SAX that handles any XML > event in a way that is optimised for handling in Java instead of for > handling using xml or procedural work, without deciding for you what to > do with it in terms of storage, character vs binary data, etc. > > I wrote some code for this in XCommander (which resides in avalon-apps) > which I still plan to rip out some time when I have time, or plan to > help someone do exactly that. I got the delegating sax parser from an > old JavaWorld article, I think, and from some discussion with Pete (who > was working on something similar within ant at that time, IIRC). > > I'm guessing similar code exists in Ant, Cocoon, Batik and other > programs that do the low-level xml stuff (I think it is _not_ in Xerces > or Xalan in this form, tho' - they're optimised for performance rather > than extensibility in this particular way).
In Cocoon scratchpad there's a Transformer that tries in his way to shield the programmer from the SAX events. An example of a class using it is: http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/scratchpad/src/org/apache/ cocoon/transformation/Chart2SvgTransformer.java?rev=1.1&content-type=text/vn d.viewcvs-markup It uses an Event system: objects register themselves to be notified when there is a certain condition on the SAX pipeline. > the way I'd see it what you need here is > > - an excalibur subproject that provides this delegating sax parser > - a rewrite of excalibur's SAXConfigurationBuilder to use this > - an extension of SAXConfigurationBuilder for JMeter that handles > JMeter's specific use case. > > I don't exactly understand that use case yet though, so I might be > wrong. I should do some lookup in the archives about what I thought > about all this :D Cool. Why not in commons-sandbox? -- Nicola Ken Barozzi [EMAIL PROTECTED] - verba volant, scripta manent - (discussions get forgotten, just code remains) --------------------------------------------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>