tags:

views:

411

answers:

2

I have this PHP web application.
It has a link to an XML file to which I have no control.

How can I make the XML display nicely?

I just want it to line up in a table or it can even look like a data file.

Can I attach an XSLT file or style sheet to the XML file from the outside i.e. I wish I could, but I can't put this in the XML:

<?xml-stylesheet type="text/xsl" href="tabledisplay.xsl"?>

The only thing I can think to do is create a link to a PHP file which reads the XML into a string, inserts the XSL reference, and then prints everything to the browser.

+1  A: 

http://ca3.php.net/xsl

paquetp
+2  A: 

The safest route is to read the xml file and transform it on server side plus insert a link "save the original xml" into it if this is necessary.

Simply inserting an xsl file reference will almost always work if the xsl and the xml are on the same domain, but between different domains there could be problems.

Csaba Kétszeri