Kimbro Staken wrote:

> Right now we have a method XMLResource.setContentAsSAX() that returns a
> ContentHandler that can be used to set the content of the resource. I'm
> wondering what are the real use cases for exposing this method? Clearly
> getContentAsSAX() is necessary and useful but I'm not so sure about
> setContentAsSAX().
>
> It seems unnecessary since it would require the application to manually
> run a parser to utilize the ContentHandler and I'm not sure what the
> benefits would be. To me it makes more sense that if you need to do that
> you should just hand text to setContent and let it handle it in the
> "optimum" way for a particular implementation.
>
> I'm not an expert on SAX so I'd love to get some more insight into the
> usefulness of this method.
>

Very frequently SAX programs don't directly parse a text stream rather chain
SAX events streams through SAXFilters etc. Indeed my XMTP MIME <-> XML
application (http://www.openhealth.org/xmtp) parses native MIME as SAX
events, so text XML is never involved, yet this can feed into XSLT
transforms etc that accept SAX event streams -- and via this mechanism an
XML:DB compliant database would become an email repository.

setContentAsSAX should return a ContentHandler. endDocument() signals that
the SAX stream is finished if knowing this is necessary for further
processing.

-Jonathan



----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact adminstrator:   mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------

Reply via email to