I found no way to bind SAX events effectively. Two options are available:
- SAXSource - you must buffer events and then send them out on parse() method on XMLReader.
- Provide StAX stream.
Both require buffering of SAX events, which can be a trouble in case of large XMLs. It kills all the elegancy and small memory foot-print.
An alternative would be to use StAX pipelines, which makes XSLT for example less effective.
I hope I mess something in docs, but...
So I must abandon the idea of using XQJ with C3 and Sedna for a moment, additional reasons: Sedna doesn't support latest XQuery things XQJ is good for and available XQJ implementation has closed source.
I switch back to default Sedna API.