Loading login details...

DeltaXML Support Forums

 new topic  post reply 
moderators: chrisc nigelw tristanm
Simpler format for delta file
Joined: 02-October-2007
Posts: 3
Location: Malvern, United Kingdom
Posted: 02-October-2007 10:35
Question by email re-directed to support forum:

Hi,

I have downloaded an evaluation copy of DeltaXML and impressed with the features. Could you please let us know –

   1. Can we generate simple xml format as an output with simple flag of ‘UPDATE’,’DELETE’, or ‘INSERT’ rather than complex format with deltaxml:delta.

   2. If no, do you have already written parsers which could parse generated output files and create java objects, so that we can do further database operations based on flags and values.

Thanks & Regards,
Convert delta to simpler format
Joined: 28-March-2007
Posts: 3
Location: Malvern, United Kingdom
Posted: 02-October-2007 11:03
  1. Can we generate simple xml format as an output with simple flag of 'UPDATE', 'DELETE', or 'INSERT' rather than complex format with deltaxml:delta.

Yes, this can be done by processing the delta file, e.g. with XSLT. If by simple flag you mean an attribute, then I suggest you convert deltaxml:delta='add' to flag='insert'.

If you prefer to have an element, then convert as follows:

<para deltaxml:delta='add'>This is added</para>

to

<INSERT>
  <para>This is added</para>
</INSERT>


As the delta file is pure XML, you can convert it to whatever you want, even into SQL for example to generate a SQL update script direct from the delta.

  2. If no, do you have already written parsers which could parse generated output files and create java objects, so that we can do further database operations based on flags and values.


There are standard tools available to do this, so we have not written any  ourselves. You can convert the XML delta file into a DOM, e.g. using W3C DOM, xom, dom4j; or you could use a JAXB like tool to create schema/dtd specific java objects.

Another possibility is to use an SQL extension to XSLT so that your database operations can be driven by XSLT. For example:
http://saxonica.com/documentation/sql-extension/intro.html

Let us know if you need more information on this.
 new topic  post reply  To find out about new replies to this post as they occur
please subscribe to one of these feeds:
AtomRSS moderate