Stefano Mazzocchi wrote:
> Now, how can this be handled? should we reverse the Source interface and
> come up with a "Destination" (sort of InputStream/OutputStream
> parallel)?
>
> If this XML contained data, we could come up with an automatic
> relational mapping between the arriving XML and the SQL update query on
> a RDBMS. It could be pretty straightforward.
>
> At the same time, how would you do such a thing on an article stored on
> a native XML DB?
>
> As Jeremy pointed out, XUpdate is a choice. I must tell you that I don't
> like XUpdate that much, but I admit it's a choice.
I badly need here someone to enlighten me. I was unable to come up with
a use case where XSLT could not be used instead of XUpdate. Admitedly,
XUpdate is easier, but I see no real advantage in using it other than as
a more comfrotable way to express updates. Actually, when I was
proposing XUpdate I was scared by the fact that the one and only
implementation (Lexus) seemed to be dead, and I was thinking about
rewriting the XUpdate engine around on the fly XSLT generation and
Transformer APIs...
> Now, the real question is: do we need any special protocol handlers for
> these things?
>
> In all honesty, I say that it's, again, up to you: you might find it
> easier to come up with something like
>
> Destination d = DestinationFactory.create("dbxml://host/db/path/");
I have a basic concern here. URLs are, as the name suggests *locators*
or *identifiers*. The idea is that via a URL you can locate (identify)
data and fetch them: they were not designed to handle the opposite case
where you have to send data to them. The HTTP POST is a workaround which
is HTTP specific and goes way beyon the URL concept: there is no way to
express in the URL syntax the *direction* of the data flow. And if you
can't tell, looking at a URI, if it's "read" or "write" you will end up
with troubles using it in an intermixed way.
What can be done, of course, is to use the URL to lookup a resource and
operate on the result (getting an OutputStream or an XmlConsumer to
write or send events to). This is easy for existing resources. But what
happens when you get ResourceNotFoundException? Should you pass the
error or just create a new (empty) resource with the name given as the
URI? I think that this is an arbitrary decision that has nothing to do
with the URL concept, and this kind of scares me.
I wonder if the Netbeans "Extended URL" can be of any help in discussing
these issues.
Ciao,
--
Gianugo Rabellino
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]