UPDATE just a node of a XML document

Hi all,

I’m working on a POC with Tamino 4.1.1. The objective is to save on Tamino a set of records of customers (we have created a xml schema that gives support to customer information).
We have no problem with this first step.

After that, we have to process new information about the customer, which arrives from other applications, and add this information to the xml document of the customer that we have already stored on Tamino. The idea is to add new information, not to update the data added before.

Just as an example:


Juan
Gonzalez



112
5
WHEELS




This could be an example of an initial customer xml doc. The idea is to add a new order in the orders list.

I have tried to do that in a Java program using the Tamino Java API.
I receive the id of the customer and the new order from the external application, then I generate the xml document for the order (just the order node) and with a xquery I try to update the customer xml document:


String Order = "11310WHEELS"
String XqueryCust = “update insert “+ Order +” into input()/CUSTOMER/ORDERS[/CUSTOMER/@id=‘33’]”;
TXQuery xqueryCustomer = TXQuery.newInstance(XqueryCust);
TResponse responseCust = xmlObjectAccessor.xquery(xqueryCustomer);


I can make the update, but it takes too much time. If there is only a few customers saved on Tamino, there is no problem, but when there are about 12000 xml documents stored in Tamino, the update of just one customer spend about 1 minute to finish.

So, I suppose I’m doing something wrong.

Please, could someone tell me how to update a node of an XML document stored in Tamino on better times.

Thank you,

No

Hi No

Hi Stuart,

just perfect. The new query is the solution for the time problems.

I would like to ask you just one more question. Could you tell me where I could find more information about xquery expressions in order to improve query performance?

Thank you, and best regards,

No

Hi No

Stuart,

Any suggestions for updating/replacing multiple Elements in a doctype, for some where condition.

Thanks,
Ravi.

Hi Ravi, currently the only recommendation for performing multiple node level modifications is to perform to consecutive XQuery FLWUExpr operations.

hope this helps.

Stuart Fyffe-Collins
Software AG (UK) Ltd.

Hi Stuart,

If I understood properly, you meen to say, If I had to update multiple elements, then each element should be updated/replaced individually. Wont’ this be a major performance backlog.

Hey!, Stuart, One more thing, could you tell me How do I update a CData section using XQuery. I am in a very urgent need of info. regarding this. In one of the forum post, it is been said that this wouldnt’ be possible.

Ravi.

Hi Ravi,

After a little more investigation I’ve found that you can perform multiple update providing that each insert/replace/… statement within the FLWUExpr expression doesn’t update the same node otherwise you get errors such as INOXQE6451 Conflicting update operations. So if you are updating different parts of the document you can have mulitple updates within the one expression.

With regards to updating a CDATA section, I couldn’t find a way; but Trevor has replied to this in this thread.

Hope this helps.

Stuart Fyffe-Collins
Software AG (UK) Ltd.