Per Nyfelt wrote:
> 
> Me again :)
> 
> org.xmldb.api.base.Resource has a method getContent() that returns an
> Object. which I take to describe a very abstract behaviour for data
> manipulation, so far so good.
> 
> In org.xmldb.api.modules.XMLResource there is getContent, getContentAsDOM
> and getContentAsSAX but there seem to be the expectation that getContent
> here should in fact return a String.
> 
> I went with storing Node's in the implementation of XMLResource so my
> "native format" is Node and not String as in the reference implementation,
> hence it would be natural for me to return the Node object for getContent
> instead of converting it to a String.
> 
> What I'm suggesting is that there is an additional method added to
> XMLResource called getContentAsString() or possibly getContentAsText() that
> would match the content retrievers for DOM and SAX and make things very
> clear.

The idea with getContent was to make it possible to work with the
default representation of multiple resource types without calling a
special method. For XMLResource the default behaviour for getContent is
to always return a string. 

Are you suggesting getContentAsText() should be in addition to
getContent() or should replace it? I agree it would be clearer in the
XMLResource context but I like the idea of as long as you have a
Resource you can call getContent to get the default representation. 

Anyone else have any thoughts on this?

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

-- 
Kimbro Staken
The dbXML Project
http://www.dbxml.org/

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