Xml conversion

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sarbas
Forum Commoner
Posts: 64
Joined: Thu Jan 04, 2007 5:51 am

Xml conversion

Post by sarbas »

Hi to all ,


I want to display the out put of the php file into xml format. I've no clue.If anyone can help me?

Waiting for your hopeful reply
Sarbas.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Please be more specific.
sarbas
Forum Commoner
Posts: 64
Joined: Thu Jan 04, 2007 5:51 am

XML

Post by sarbas »

volka wrote:Please be more specific.
Sorry Volka,
I didn't specify complete details about this issue here i try to describe,


I need a script that will take a few scripts that I have and convert them into PHP functions which can be called with URL parameters. The script needs to change the HTML output into XML and then create a script which reads that XML and displays it like the original HTML looked.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: XML

Post by volka »

sarbas wrote:I need a script that will take a few scripts that I have and convert them into PHP functions which can be called with URL parameters. The script needs to change the HTML output into XML and then create a script which reads that XML and displays it like the original HTML looked.
You want to write a script (let's call it convert.php) that reads the source code of another script (let's call it old.php) like

Code: Select all

<?php
echo '<form name=xyz method=post action=lalala.php>';
...
echo '</form>
?>
and then writes a converted script (let's call it new.php) like

Code: Select all

<?php
function foobar($param) {
  echo '<form name="xyz" method="post" action="lalala.php">';
  ...
  echo '</form>';
}
?>
?
sarbas
Forum Commoner
Posts: 64
Joined: Thu Jan 04, 2007 5:51 am

Post by sarbas »

Thanks Again volka,


But I don't know how to bring xml output after running php file.
For Example I've test.php.

test.php consists of some tables and data. After executing test.php i'll get the results in xml format.

just i want result of test.php in xml format.

Waiting for your hopeful reply
Sarbas.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

hm, my last post was a question. Anyway...
If you only want to convert the output from valid (but not x-)html to xhtml you might be interested in http://de2.php.net/tidy
Post Reply