|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
XML and XSLT + PHP question...
Can anyone shed some insight to how I can fix this problem...
I have 6 files... events.xml - an ordinary XML document. events.xsl - an ordinary XSL stylesheet header.php - a PHP file that contains the first half of the website design footer.php - a PHP file that contains the last half of the website design. upcoming.phtml - the PHP file that the end user will see. My question is this, is there an alternative to Sablotron, the built in toolkit in PHP4? My web host doesnt have PHP compiled with the --with-sablot argument. I have requested this, but I havent heard anything back yet, and I am searching for an alternative. I need to parse the XML document, apply the XSL stylesheet, then insert it into the phtml file like so... PHP Code:
Any suggestions? I originally tried a require("events.xml"); with the XSL stylesheet applied within the XML document, but I forgot that inside the PHTML file, the server won't just normally parse the XML document. I bet there is an easy answer, and I am just missing it, but any help is appreciated. |
|
#2
|
|||
|
|||
|
How about doing something like
require("header.php"); readfile("events.xml"); require("footer.php"); readfile() will read the events.xml file and output it to the browser. If you have the <?xml:stylesheet type="text/xsl" href="events.xsl"?> line in events.xml it should also parse that and apply the xsl stylesheet. If that doesn't work, check out www.phpwebhosting.com . They support sablotron (and just about every other extension). You can see a phpinfo() page at http://blinkin.phpwebhosting.com/phphoststest.phtml |
|
#3
|
||||
|
||||
|
Re:
Thank you for your feedback, but right after I posted that I read about the SAX parser in the DevShed XML page. That seemed to do the trick for me very nicely.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XML and XSLT + PHP question... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|