Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML from PHP, how to apply the XSL

Status
Not open for further replies.

JamesFlowers

Programmer
Mar 23, 2001
97
GB
I have the code as below , but I cant work out how to apply the XSL file for formatting? Any ideas, Thanks.

<?php header("Content-Type: text/xml"); //set the content type to xml?>
<?php include 'dbconn.php'; // database Conn?>
<?php include 'sql.php'; // SQL?>
<?php
$xmlBody = '<?xml version="1.0" encoding="ISO-8859-1"?>';
$xmlBody .= "<XML>";
while($row = mysql_fetch_array($sql)){
$country = $row["country"];
$xmlBody .= '
<Customers>
<Country>'.$country.'</Country>
</Customers>';
}
mysql_close();
$xmlBody .= "</XML>";
echo $xmlBody;
?>

James Flowers
Crystal Consultant
 
The php.net pages are more about using XML as a datasource not an output.

James Flowers
Crystal Consultant
 
Hi James,

this link should give you all you need:

Regards,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
JamesFlowers said:
The php.net pages are more about using XML as a datasource not an output.

Perhaps you could provide a specification a little less vague. For example, do you want to apply the transform on the server, or on the client? What do you expect the result to look like? Better problem statement might provide better advice...

Tom Morrison
Micro Focus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top