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

> BTW, do we really need to be able to support mixed binary/XML within the
> same collection?

Yes. Restricting it would sort of be like saying a table can only have
CHAR columns.

> > > In Collection there should probably be a getChildCollection method to
> > > retrieve a collection relative to the current collection.
> > >
> > > In Collection there is currently a getChildCollections method that
> > > returns a list of Collection instances. This would probably be better as
> > > a listChildCollections method that returns a list of child collection
> > > names instead of actual collection instances. You could then use
> > > getChildCollection to retrieve the Collection instances as needed.
> > >
> 
> Any opinion on this change?

+1


-- 
Ronald Bourret
Programming, Writing, and Training
XML, Databases, and Schemas
http://www.rpbourret.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