I need to handle a lot of incoming XMLs which may be rather complex. A typical situation is the following:
<SomeNode>
<Request>
<Id>1</Id>
<!-- Request specific stuff -->
</Request>
<Request>
<Id>2</Id>
<!-- Request specific stuff -->
</Request>
<Response>
<Id>1</Id>
<!-- Feedback on request no. 1 -->
</Response>
<Response>
<Id>2</Id>
<!-- Feedback on request no. 2 -->
</Response>
</SomeNode>
Note that SomeNode doesn't have to be a top node. I have to match these requests with requests already stored in my database, i.e. if a request in an incoming XML doesn't match a record in the db, I need to take action. Usually I will ask the user to manually match the parts of the XML that isn't recognized, and re-process the XML according to these manual rules. Any "error" (both failure and success) should be logged accordingly, preferably with some level of detail.
Finally, it is worth pointing out that there are many different types of XML coming in to my system - hard coding the processing logic is probably not what I want. Re-compiling and shipping a new executable just to handle a new kind of message is too cumbersome. And of course: time is money. Implementing new kind of XMLs should be as fast and as reliable as possible.
At the moment, I'm more interested in technology than specific implementations. Is XQuery a good place to start? Or is this perhaps overkill? Will XPath 1.0 get us all the way, or do we have to use 2.0? Perhaps we don't need any sophisticated processing at all, so that basic XML parsing may suffice? What do you guys think?
I'm sorry for the long post, but we all know the GIGO principle don't we? :)