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

  • Home
  • SEARCH
  • 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 8746183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:09:19+00:00 2026-06-13T12:09:19+00:00

Hi I got a bit of a problem, I am retreiving an XML like

  • 0

Hi I got a bit of a problem,

I am retreiving an XML like so:

    // create new document object
    $dom_object = new DOMDocument();
    // load xml file
    $dom_object->load("http://www.mhs2000.de/hpm/v6/machinelist-master.php?hid=1007&lang=de&GroupID=01002");

    $item = $dom_object->getElementsByTagName("product");

        foreach( $item as $value )
    {

    $nos = $value->getElementsByTagName("MachineNo");
    $no  = $nos->item(0)->nodeValue;
    $machineno = str_replace( "1007-", "", $no );

    $herstellers = $value->getElementsByTagName("Make");
    $hersteller  = $herstellers->item(0)->nodeValue;


    $types = $value->getElementsByTagName("Type");
    $type  = $types->item(0)->nodeValue;

    $labels = $value->getElementsByTagName("NewIn");
    $label  = $labels->item(0)->nodeValue;

    $controltypes = $value->getElementsByTagName("ControlType");
    $controltype  = $controltypes->item(0)->nodeValue;


    $bildurls = $value->getElementsByTagName("BildUrl");
    if($bildurls->length == 0)
    {
        $bildurl = ("/wp-content/themes/framework/images/logo.jpg");
    }
    else
    $bildurl  = $bildurls->item(0)->nodeValue;

    $tdetailsformats = $value->getElementsByTagName("tdetailsformat");
    $tdetailsformat  = $tdetailsformats->item(0)->nodeValue;
    $tdetailsformat = str_replace( "|", " ", $tdetailsformat );
    $tdetailsformat = str_replace( "%", "", $tdetailsformat );


    echo "<div class=\"row span_16\">";
    echo "<div class=\"col span_4 clr\">";
    echo "<a href=\"$bildurl\">";
    echo "<img src=\"$bildurl\" class=\"thumb\">";
    echo "</a>";
    echo "</div><div class=\"col span_12 clr\">";
    echo "$machineno $hersteller - $type - $label - $controltype - $tdetailsformat";
    echo "</div>";
    echo "</div>";
    }

So everythings working fine, but What do I have to do to put a Table around the results?

When I open a tag it appears below my results.

<div class="col span_12 clr">6056 HELLER - BEA 05 - 1986 - CNC - x-Weg 500 mm y-Weg 400 mm z-Weg 560 mm Spindeldurchmesser 70 mm Aufnahme SK 40 </div>
<table></table>

Thanks in advance.

  • 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-06-13T12:09:20+00:00Added an answer on June 13, 2026 at 12:09 pm

    Open the table tag before the foreach loop:

      <table>
        <tr>
          <td>MachineNo</td>
          <td>Make</td>
           .... Add rest of the header items like above
        </tr>
    

    Start the foreach:

        foreach( $item as $value )
        {        
           echo "<tr>";
    
           $nos = $value->getElementsByTagName("MachineNo");
           $no  = $nos->item(0)->nodeValue;
           $machineno = str_replace( "1007-", "", $no );
    
           echo "<td>$machineno</td>";
           //.. Likewise, add rest of the td's after processing each node
    
          echo "</tr>";
    
         }
    

    Close your table:

         </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
I got a bit of a problem with a Oracle query create or replace
This will seem like an odd problem to have. I've got this bit of
I've got a bit of a problem with making my data loading and filtering
I've got a bit of a problem. Essentially, I need to store a large
I've got a bit of a problem. I'm currently working on converting an old
I've got a bit of a problem. In order to grow in my knowledge
I'm building a new app and got a bit confused of Howto do it:
I've got a bit problem. My program throws segmentation fault when returning zero in
I have got a bit of a problem. I have two pages (Thumbnail.aspx &

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.