note 47772 added to function.xsl-xsltprocessor-import-stylesheet
| From: | zerok at www dot zerokspot dot com | Date: | Mon, 29 Nov 2004 15:00:25 +0000 |
| Subject: | note 47772 added to function.xsl-xsltprocessor-import-stylesheet | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81154@lists.php.net to get a copy of this message | ||
As a simple solution for multiple stylesheets you could simple build your own little XML string
that <xsl:import/>s all the stylesheets you want to have.
<?
class XslTemplate{
private $stylexml;
/* ... */
function __construct(){
/* ... */
$this->stylexml =<<<EOD
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--IMPORTS-->
</xsl:stylesheet>
EOD;
}
public function importStyle($path){
$this->stylexml = str_replace('<!--IMPORTS-->',"<xsl:import
href=\"".$path."\"/>\n<!--INCLUDES-->",$this->stylexml);
}
public function process($string){
/* $this->proc->importStyleSheet(DOMDocument::loadXML($this->stylexml)) etc. */
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.xsl-xsltprocessor-import-stylesheet.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47772
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47772&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47772&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47772&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47772&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47772&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47772&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47772&report=yes
Search -- http://master.php.net/manage/user-notes.php