[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.