Personally I find xquery update insert unworkable. At the moment I’m working at the Customer’s site with Tamino API for .NET.
Here we work with complex data with a lot of optional nodes and choices.
Now I was hoping that xquery update would do a wonderfull job but I find myself writing a lot of unneccessary complex code just in order to determine which ancestor sibbling is present. Who sets the standard for xquery update? Ever thought about it to really use it in the field?
Now I have chosen to abondon xquery update in favor of the _process command.
The recipy is:
Deserialize (or is it dehydrate?) the result into an object presentation (take Tamino schema and generate an object using xsd.exe), modify the object and _process the result (). Real simple and very efficient.
A pitfall to watch out for: do not duplicate elements inline, but define these on the global level. xsd has some trouble with these kind of schema’s.
() I find it a shame that I have to turn the serialized data into XmlDocument for the purpose to store it in the database (via TaminoDocument wrapper). Can’t you support more types of input sources, like Stream and XmlReader.
I do hope that xquery update insert will become more user friendly in the (near) future…
Kind regards,
Rudolf de Grijs
#webMethods-Tamino-XML-Server-APIs#webMethods#API-Management