This is continued from http://phpbuilder.com/board/showthread.php?t=10313971 which I set as resolved but have since encountered problems...
I'm basicly just trying to include () an xml file in a php page.
I've run into some unexpected problems with this though...
I have an XML file which references an XSL file. When I open the XML file in a browser it correctly applies the XSL and sorts and formats the XML. The tutorial I followed to creat this is here - http://www.w3schools.com/xsl/xsl_sort.asp.
Problem 1 is that when I try to include () the xml file I get a parse error. I think that this is due to the xml declaration and the xsl declaration at the start of the .xml file being enclosed in <? ?>.
This brings me to question 1: How do I turn off short tags so it'll only parse <?php ... ?> rather than everything in <? ... ?>. I'm using php5 on apache server if that helps... I had a brief search through both manuals but couldn't find referance to short tag format in either (I'll have a proper look later though)
Moving on...
On this page there are a number of ways offered in the user comments at the bottom for getting round this problem - basicly using echo () to generate the xml declarations;
http://www.php.net/manual/en/language.basic-syntax.php
I've tried several and, while I no longer get the php parse error, the xml file isn't finding the xsl so all the xml is just displayed as plain text...
So heres question 2: Why is the xml file not linking to the xsl correctly? Is it just because the browser isn't recognising it as xml because I 'cheated' php into echoing the xml and xsl sheet declarations (in which case I assume resolving question 1 will sort this out too) or am I missing something more serious?
Hope that all made sense!
EDIT: Shrike has kindly pointed me in the right direction with regards to turning short tags off which I'll try when I get home from work. Will post back how I get on...