473,378 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

xml file to print to help in html table data.

Hi, I need your help.

xml file(exaproperties.ashx):

<?xml version="1.0" encoding="utf-8"?>
<ROOT>
<STOKLAR>
<STOK Stok_Kod="" Stok_Ad="">
<OZELLIKLER>
<OZELLIK></OZELLIK>
<DEGER></DEGER>
<OZELLIK></OZELLIK>
<DEGER></DEGER>
<OZELLIK></OZELLIK>
<DEGER></DEGER>
<OZELLIK></OZELLIK>
<DEGER></DEGER>
<OZELLIK></OZELLIK>
<DEGER></DEGER>
<OZELLIK></OZELLIK>
<DEGER></DEGER>
</OZELLIKLER>
</STOK>
</STOKLAR>
</ROOT>

--------------------------------------------

This way you can print:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $root = simplexml_load_file("exaproperties.ashx");
  4.  
  5. foreach ($root->STOKLAR->STOK as $stok) {
  6.     foreach ($stok->OZELLIKLER as $ozellikler) {
  7.     for ($i=0;$i <=count($ozellikler);$i++){ 
  8.  
  9.                      echo '<table>' ;
  10.                      echo '<tr>' ;
  11.                      echo '<td ALIGN="left" VALIGN="TOP" BGCOLOR="#FFFFFF">'.$ozellikler->OZELLIK[$i].'</td>';
  12.                      echo '<td ALIGN="left" VALIGN="TOP" BGCOLOR="#FFFFFF">:</td>';
  13.                      echo '<td ALIGN="left" VALIGN="TOP" BGCOLOR="#FFFFFF">'.$ozellikler->DEGER[$i].'</td>';
  14.                      echo '</tr>' ;        
  15.                      echo '</table>' ;
  16.                      $i++;
  17.  
  18.         }
  19.         }
  20.         }
  21.  
  22. ?>


----------------------------------------------------
However, only the html table is added to the database, data is not added into HTML table cells.

Expand|Select|Wrap|Line Numbers
  1. $xmlData = simplexml_load_file($xml_directory.$this->code."/exaproperties.ashx");
  2.          foreach ($xmlData->STOKLAR->children() as $STOK) {
  3.          foreach ($STOK->children() as $OZELLIKLER => $data) {
  4.          for ($i=0;$i <=count($data);$i++){
  5.  
  6.                      $tablo = '';
  7.                      $tablo.= '<table>' ;
  8.                      $tablo.= '<tr>' ;
  9.                      $tablo = '<td ALIGN="left" VALIGN="TOP" BGCOLOR="#FFFFFF">'.$data->OZELLIK[$i].'</td>';
  10.                      $tablo.= '<td ALIGN="left" VALIGN="TOP" BGCOLOR="#FFFFFF">::</td>';
  11.                      $tablo.= '<td ALIGN="left" VALIGN="TOP" BGCOLOR="#FFFFFF">'.$data->DEGER[$i].'</td>';
  12.                      $tablo.= '</tr>' ;        
  13.                      $tablo.= '</table>' ;
  14.         }
  15.     }
  16. }


----------------------------------------
If the support I rejoice.(Sorry for bad english)
Mar 26 '14 #1
0 986

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Sugapablo | last post by:
Before I go building this, I want to know if it already exists. I need some PHP code that will read a web page and return all text that comes between <td></td> tags in an array. So if there...
11
by: alex | last post by:
Hi, I am looking for a way to populate an HTML table from an external local text file which looks like this: DATE/TIME LAT. LON. DEPTH. ML....
0
by: gian-carlo | last post by:
HI there I need help I have to build a web interfaced products database with product descriptions in several languages, Franch, Italian, German, .... and Russian, yes Russian as Cyrillic font...
3
by: Yellowbird | last post by:
I have an HTML form with a pre-built table containing "standard" column headings (for example, First Name, Last Name, SSN, Hours, etc.). I want a user to be able to enter values into the form and...
13
by: DH | last post by:
Hi, I'm trying to strip the html and other useless junk from a html page.. Id like to create something like an automated text editor, where it takes the keywords from a txt file and removes them...
10
by: Greg Lovern | last post by:
I have a very large html table created by MS Word, saved as it's "Web Page, Filtered" file type. Every html table cell has lots of formatting tags. Most of the file size is that formatting. Is...
2
by: susinthaa | last post by:
Hi All, Good Morning! My requirement is as below: I am having a HTML table and the text boxes are embedded as a row of the tabel. And I am having a button at the end of the page. When I...
0
by: Sourik | last post by:
I have a servlet with html table data.I need to display the rows from that table in the servlet in another html page. The bar is in the forwarded html, I cannot use jsp or any scriplet. What will be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.