SunQuest
           XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old January 8th, 2002, 10:21 PM
Pasiphae1213's Avatar
Pasiphae1213 Pasiphae1213 is offline
Web Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Pennsylvania
Posts: 171 Pasiphae1213 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Pasiphae1213 Send a message via Yahoo to Pasiphae1213
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:
require("header.php");
// XML data with XSL stylesheet applied to it.
require("footer.php"); 


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.

Reply With Quote
  #2  
Old January 8th, 2002, 11:39 PM
xamichee xamichee is offline
Bringer of the Bling
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: Orlando, FL
Posts: 68 xamichee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via AIM to xamichee
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

Reply With Quote
  #3  
Old January 8th, 2002, 11:42 PM
Pasiphae1213's Avatar
Pasiphae1213 Pasiphae1213 is offline
Web Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Location: Pennsylvania
Posts: 171 Pasiphae1213 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Pasiphae1213 Send a message via Yahoo to Pasiphae1213
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XML and XSLT + PHP question...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway