| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2004
25 posts
Gave thanks: 0
Thanked 0 times
|
viewing xsl formatted xml as xhtml
I created a page that is xml formatted with xsl, and have it looking the way that I want it to in IE6. Now I would like it to convert this page to various other formats...xhtml, pdf, etc. Does anyone know how this can be accomplished?
The following PHP code will do the conversion to XML <?phpBut I am recieving an error: Warning: domdocument() expects at least 1 parameter Fatal error: Call to undefined function: load() What is the missing parameter? I got the code of php.net, so it should be complete. I have found that Apache Xalan will do these transformations, but I am unfamiliar with it. Does anyone have any wise words for me? Last edited by whitee; October 2nd, 2004 at 2:47 PM.. |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2004
25 posts
Gave thanks: 0
Thanked 0 times
|
XHTML Problem Solved
I had been using PHP5 code....the following works for PHP 4.3. It creates a DOM XML document, applies the xslt stylesheet to transform the data, and then converts it to xhtml and outputs it to the browser.
<?php $xmlpath = dirname("full_file_path") . "//"; $xmldoc = domxml_open_file( $xmlpath . "file.xml"); $xsldoc = domxml_xslt_stylesheet_file ( $xmlpath . "file.xsl"); $result = $xsldoc->process($xmldoc); print $result->dump_mem(); ?> I still need to figure out how to output to a PDF file. |
|
|
|
|
|
#5 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2004
25 posts
Gave thanks: 0
Thanked 0 times
|
Alex,
Whether or not you can edit your php.ini file depends on your setup. My site is hosted on Surpass servers, so I couldn't make the necessary changes to use the features that I wanted. I just decided to wait until I was hosting my own site (which didn't happen as I had planned). |
|
|
|
|
|
#6 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2005
2 posts
Gave thanks: 0
Thanked 0 times
|
Whitee
hummm...did you ask support in this matter? I am just trying ot display an rss feed from another site in my site. i think it can be done, but am still learning here. I am using php in combo with wordpress. just trying to get the server to translate the XSLT fragment. well thanks for the reply. good luck there with you site. |
|
|
|