[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problem with OzoenEnv.bat and some XML:DB questions



> > In org.xmldb.api.modules.XMLResource the getter and setter for SAX is
> > flipped
<snip>
>
> Even though it seems wrong the API is actually correct. When you want to
> retrieve content from the API as a SAX event stream you want to provide
> your own ContentHandler implementation to do your application specific
> processing of the content. This is why getContentAsSAX takes a
> ContentHandler as a parameter. The implementation uses that
> ContentHandler, which is your own implementation, to parse the XML.
>
> For setting content you need to retrieve a content handler from the the
> API that knows how to store the SAX event stream to the database. You
> can then use that ContentHandler as part of your application specific
> SAX parse to store XML content into the database.

OK, I see. Thanks for setting me straight.

> > What happened to org.xmldb.api.modules.SAXResource and
> > org.xmldb.api.modules.DOMNodeResource?
>
> These have been merged into XMLResource. The use case would now look
> more like.
>
> XMLResource resource = (XMLResource) collection.getResource(id);
> Document doc = (Document) resource.getContentAsDOM();

OK, makes sense. I'll use the CVS version instead to be more up to date
then.

Best regards,
Per