RE: updating data on the server using XSLT and XT servlet?

Subject: RE: updating data on the server using XSLT and XT servlet?
From: Ross Bleakney <rossb@xxxxxxx>
Date: Thu, 2 Dec 1999 11:47:15 -0800
James,
You are correct, I should not have used the word elegant. What I meant was
that my solution is not generic. Since this is probably a common problem, it
might be nice to have a generic solution. I know of no XML API that allows
for modifying a document. They make it easy to create new documents out of
old ones, but they don't allow you to modify an existing file. Doing so
would mean the possibility of optimization that would greatly reduce disk
I/O. For example, if you had XML like this:

<Events>
   <Event>...<Event>
   <Event>...<Event>
</Events>

It would be really nice to write code like this:

	ModifyXML modXML = new ModifyXML("MyDoc.XML");	
	Element event = modXML.createElement("Event");
	event.appendChild(modXML.createTextNode("A big event happened"));
	modXML.appendChild("Events", event);
	modXML.update();

An implementor of this interface could take advantage of the fact that
<Events> is the main tag and perform the same sort of work I suggested
(backing up from the end and then writing). The routines for this interface
would be very limited since this would only be used when you want to modify
a document and you know that using SAX (or DOM) is inefficient. Thus there
would be no reason to have an "insertBefore". The API could be limited to
appending and deleting. 

Is there something like this already?

Thanks,
Ross

-----Original Message-----

>Bart,
>I don't have a solution but I have the same problem. If you get a response
>(and it is not posted) please send it to me. I was simply going to write a
>Java program that would open the file, get the end of it, back up a little
>ways, write the element and then rewrite the end tags. This is hardly
>elegant, but it is efficient.
>Thanks,
>Ross

Why isn't this elegant?

You don't need to use a ten-tonne truck
to crack a nut ...

Just because we are working with XML, it doesn't
mean we have to throw away all our current text-processing
tools.

J

-------------------------
James Robertson
Step Two Designs Pty Ltd
SGML, XML & HTML Consultancy
Illumination: an out-of-the-box Intranet solution

http://www.steptwo.com.au/
jamesr@xxxxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread