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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:17:26+00:00 2026-05-29T08:17:26+00:00

I am parsing an xml file successfully in PHP, but having difficulty parsing a

  • 0

I am parsing an xml file successfully in PHP, but having difficulty parsing a specific entry trying to output a table.

My xml is as follow

<OutputData Name="ExchangeRate" ContentTypeID="">
    <DataTitle>Exchange</DataTitle>
    <DataInfo>
        <TABLE CLASS="DataTable">
            <TR><TD>1.00 GBP = 1.68 ALL</TD></TR>
            <TR><TD>1.00 USD = 1.58 ALL</TD></TR>
            <TR><TD>1.00 EUR = 1.35 ALL</TD></TR>
            <TR><TD>Currency conversion rates as of  January 2012</TD></TR>
        </TABLE>
    </DataInfo>
</OutputData>

if I try to output it this way
$info = $outputinfo->DataInfo;
I am getting an error.

any help?

My code is as follow

$xmlfile = $currenttitle.".xml";
$info = simplexml_load_file($xmlfile);
$region = $country->Region[0]; 
$section = $region->Section;  
if($info){
  foreach ($region->Section as $sectioninfo){
    $title = $sectioninfo->SectionTitle;
    echo "<b>$title</b><br />\n";
    $output = $sectioninfo->OutputData;
    foreach ($sectioninfo->OutputData as $outputinfo){
      $titleinfo = $outputinfo->DataTitle;
      $info = $outputinfo->DataInfo;
    }
  }

for the section above, I get the Title display, as Exchange, but the Table is not rendered.

SOLUTION
Thanks to h4b0 who put me in the right direction

$rowinfo = $outputinfo->DataInfo->TABLE->TR->TD;
foreach ($outputinfo->DataInfo->TABLE->TR as $rowexchange){
  echo $rowexchange->TD."<br />";
}
  • 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-29T08:17:27+00:00Added an answer on May 29, 2026 at 8:17 am

    I guess you won’t get error if you try $info = $outputinfo->DataInfo->TABLE->TR->TD. If I’m wrong, post your error message.

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

Sidebar

Related Questions

I'm parsing an xml file and i've been trying to strip out the whitespace
I am using feedparser for parsing from XML file.But I couldn't parse <geo:lat> ,
Hey I am having issues parsing XML file, Theres seems an unrecognised symbol after
I'm able to successfully parse the contents of a XML file using TouchXML, but
I am doing this tutorial but with a diferent xml http://blog.insicdesigns.com/2009/03/parsing-xml-file-using-codeigniters-simplexml-library/ , but I
how to parse HTML tag using XML parsing I am parsing XML file but
I am trying to insert data of Books by parsing XML file. It allows
I am having a problem while parsing XML file,i used newsRSS parser as a
I am trying XML::SAX parser for parsing XML file. XML file is shown below,
I'm parsing big XML file with XPathExpression selection for some nodes existing at various

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.