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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML/PHP tutorial not working, need advice

Status
Not open for further replies.

elemental

Programmer
Mar 17, 2001
33
CA
Hey gang. I've tried the above tutorial and I've managed to set it up on the server properly, but it doesn't quite seem to work. I've cut and pasted the code from the article and IE doesn't give any error in either the xml/php, or xsl doc. But it won't display properly.
Here's what I get:


quote:
--------------------------------------------------------------------------------
Warning: Sablotron error on line none: cannot open file 'c:/program files/apache group/apache/docbook.xsl' in c:\program files\apache group\apache\htdocs\docbook.php on line 4
XSLT processing error: cannot open file 'c:/program files/apache group/apache/docbook.xsl'
--------------------------------------------------------------------------------



And the funny thing is everything is saved in the htdocs folder.
Any thoughts
The article is here:
And I'm using apache 1.3 php 4.1 on XP home
TIA
Crimson
 
Hi elemental,

I'm not sure because I'm doing all the development on Linux and not windows but don't you need tp put docbook.xsl in htdocs as well? On the code you pasted, docbooks.xsl is under apache, when it should be under apache/htdocs.

I hope this helps.

Cheers,

xso
 
WEll, ya its in there but its not finding it. the xml, xsl and php file are all in the same dir htdocs. Hmm..... I'm using HTML-kit and saved the xsl file as "all" could that be why. And could you recommend a html editor that has the option of a new xml doc and ability to actually save .xsl?
Thanks
 
Hmm. I just found the stylesheet save as option, so its now saved as .xsl for suer and in htdocs, but its still not finding it. Shall I post the xml/php and xsl file code?
XML is new to me, so bear with me please for a bit.
TIA
 
Yes, could you please post the php code? The reason I'm asking is that the parser is looking for the file under apache when it should search under htdocs. Then, it might be that the link is not referenced correctly.
Hope this helps,

Cheers,

xso

 
This is it....

<?php // Create an XSLT processor
$xsltproc = xslt_create();
// Perform the transformation
$html = xslt_process($xsltproc, 'docbook.xml', 'docbook.xsl');
// Detect errors
if (!$html) die('XSLT processing error: '.xslt_error($xsltproc));
// Destroy the XSLT processor
xslt_free($xsltproc);
// Output the resulting HTML
echo $html;?>
 
Hi elemental,

The php looks good. Could you please search for a file called httpd.conf and, in this file, search for the variable
DocumentRoot?

Maybe that the DocumentRoot is set to apache and not htdocs which might explain why the parser is searching for the file there.

Thanks and cheers,

xso
 
Well, I checked it and its configured corretly. What else can I give you?
 
Wow, it's quite weird, huh?! I guess it's the reason why I use Linux at home and Solaris at the office for web development. ;-> It's rather hard to help when you can't do it yourself (well actually I did it but on Linux and it worked).

It may sound stupid but did you try to copy those files to
c:/program files/apache group/apache/, as it's obviousely the place where the parser is searching for the files?

Cheers,

xso
 
Yeah I did move the xml and xsl file as you so kindly suggested and it worked. Strange though, but if that's what I gotta do for xml then its ok. Everything else works as its supposed to. Hey what distro u using for linux? I was thinking of putting on Mandrake. Ever use PHP/MySQL? That's the other thing I use and just put the docs in htdoc and it works. If you're on ICQ I'd love to chat sometime.
Thanks for the help I really appreciate it.
Elemental
 
Hi Elemental,

You very welcome! Glad to hear it's working now!

It's weird that it's searching for it under apache, as the DocumentRoot is under htdocs.But hey, it'working now ;->

I have used Mandrake, SuSE, RedHat, Caldera and Lycoris. The one I prefered and keep using is SuSE. But most of my friends are on Mandrake or RedHat, so it's just a matter of personal taste. Try a few distros and just pick up the one you prefer. The good point it's that it's a very good OS for web development (JSP, PHP, PostgrSQL, MySQL, Apache, Zope, Cocoon, Tomcat, many xml and xsl parsers... Everything working out-of-the box...). But I'm not too much into multimedia and games I must confess.

I use PHP, MySQL and XML every day at work. It's quite powerful and easy to use, once you are into it. And, if you are interested, there are plenty of excellent tutorials on the web.

I don't use ICQ that often (like once a year ;->), so if you wanna contact me, you can always drop me a line at xso at ifrance.com

Happy Programming and cheers,

xso

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top