Ronald Bourret wrote:
> 
> Kimbro Staken wrote:
> >
> > It can but this is mainly used to switch what representation you want
> > for XML. e.g. SAX, DOM, Text. This is definitely the one thing about the
> > API that I'm not really happy with.
> >
> > The use case looks like.
> >
> > Collection collection = DatabaseManager.getCollection("some db uri");
> >
> > // tell the API you want a DOMNodeResource when you call getResource()
> > collection.setResourceType("DOMNode");
> >
> > String id = "gladiator-2000";
> > DOMNodeResource resource = (DOMNodeResource) collection.getResource(id);
> > Document doc = (Document) resource.getContent();
> 
> I (still) haven't had a chance to look at the new API, but I had assumed
> we would simply have different methods her -- something like the
> following. (Pardon my Java-isms ;)
> 
>    void Collection.getSAXResource(id, contentHandler);
>    Document Collection.getDOMResource(id);
>    String Collection.getStringResource(id);
>    byte[] Collection.getBinaryResource(id);
> 

That was probably the biggest change in the new API. It uses a Resource
abstraction to eliminate all the different methods and make particular
resource type support (other then text XML) optional.


-- 
Kimbro Staken
Chief Technology Officer
dbXML Group L.L.C
http://www.dbxmlgroup.com

----------------------------------------------------------------------
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