note 50504 modified in function.xsl-xsltprocessor-import-stylesheet by danbrown
| From: | danbrown@php.net | Date: | Fri, 28 Nov 2008 22:13:39 +0000 |
| Subject: | note 50504 modified in function.xsl-xsltprocessor-import-stylesheet by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147314@lists.php.net to get a copy of this message | ||
For those who wants to use external documents, it is important not to use the DomDocument::loadXML
because the processor will not have the path to look for other files
So if you want to transform some xml with a pre-generated stylesheet $f:
<?php
$f = 'somestylesheet.xsl';
$xsl = DomDocument::loadXML(file_get_contents($f));
?>
document('other.xml') will not work with relative path and <?php $xsl =
DomDocument::load($f); ?> will!
--was--
For those who wants to use external documents, it is important not to use the DomDocument::loadXML
because the processor will not have the path to look for other files
So if you want to transform some xml with a pre-generated stylesheet $f:
$f = 'somestylesheet.xsl';
$xsl = DomDocument::loadXML(file_get_contents($f));
document('other.xml') will not work with relative path and
$xsl = DomDocument::load($f);
will!
http://php.net/manual/en/function.xsl-xsltprocessor-import-stylesheet.php