Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 409363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:46:58+00:00 2026-05-12T17:46:58+00:00

I need to handle a lot of incoming XMLs which may be rather complex.

  • 0

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? 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:46:59+00:00Added an answer on May 12, 2026 at 5:46 pm

    I see three parts to your problem:

    • you must first find a way to quickly and easily get the “identifying” information from the XML
    • you must then be able to check your database
    • and if it’s not already present, you need to “handle” your XML somehow

    Now for the first piece, you’ll probably just need a clever XPath expression – something like //SomeNode/Response/Id in your example here – to define how to read the “ID” – whatever that might be. So store this XPath expression in a config – you can change that “on the fly”.

    The second part is checking for existence – take the value retrieved by step no. 1 and check your database – you didn’t provide any details here and this is not XML-related, so I guess this should be fairly simple to do.

    The third step is handling the XML and again, you’re not awfully explicit about what that involves. You will most likely need another XPath to select the node to handle from the original XML, and then do whatever it takes to “handle” this XML.

    What you could do in this case is create an abstract base class that contains this logic – just the stubs of the methods to call – and thus defines the order of the steps and all.

    For each XML that you need to handle, create a concrete descendant class that then actually implements these three steps for your concrete problem you’re trying to solve.

    That way, you can capture common problems and common tasks in the base class, and handle problem-specific logic in your descendant class.

    Marc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a game where I need top handle A LOT of sound
I am developing an application which need to handle a massive amount of REST
I have a lot of handler classes that handle specific message types. To register
I am designing a rule evaluation system which need to handle a fact database
question is.... i need to handle tap gesture. Now, i have a lot of
I'm developing a network application, which will handle a lot of transactions, so I'm
I need to handle events of two different types but I'm running into the
I need to handle strings in my php script using regular expressions. But there
For a project I need to handle audio in an iPhone app quite special
I'm writing a batch (.bat) script and I need to handle the case in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.