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 6947751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:43:59+00:00 2026-05-27T13:43:59+00:00

Can anyone advise on the fastest, least resource intensive method by which I can

  • 0

Can anyone advise on the fastest, least resource intensive method by which I can see whether ‘Column Name=Error’ exists please?

I don’t want to parse the document, but simply check if elements exist.

Thanks in advance,

<?xml version="1.0" encoding="UTF-8"?>
<Table>
<Columns Items="4">
<Column Name="Error" Type="String" />
<Column Name="Description" Type="String" />
<Column Name="Cause" Type="String" />
<Column Name="Resolution" Type="String" />
</Columns>
<Rows Items="1">
<Row Error="2" Description="Unknown key" Cause="Unknown key" Resolution="Please check     the key is correct, it should be the in form AA11-AA11-AA11-AA11." />
</Rows>
</Table>
  • 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-27T13:44:00+00:00Added an answer on May 27, 2026 at 1:44 pm

    As others have mentioned, the least resource intensive would be a simple strpos() call, though that’s subject to error if the exact format of the XML ever changes. A fullproof way is to use DOM, then you could try an xpath query …

    $xml = '...'
    $dom = new DomDocument();
    $dom->loadXML($xml);
    $xpath = new DOMXPath($dom);
    
    // returns NULL if no columns found with name="error"
    $err = $xpath->query('//Column[@Name="Error"]')->item(0);
    
    if ($err) {
      // there is a column with attribute Name="Error"
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone advise? And how does the replace all method works? message = message.replaceAll((?:https?|http?)://[\\w/%.\\-?&=!#]+,
I encountered the following error when installing Bugzilla in Solaris 10. Can anyone advise
Can anyone advise me how to write an action method that handles data from
Can anyone advise? I have a job which runs on the hour, every hour,
Can anyone advise on the best cross-browser/device method to style a button with curved
For sharepoint development (I'm new to it) - can anyone advise whether I should
Can anyone advise on the appropriate SAS informat to read in a datetime (dd/mm/yyyy
Can anyone please advise where i'm going wrong with the following? I want the
Can anyone please advise me if there will be any problems changing the wordpress
can anyone give me any advice on what to do about this error ?!

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.