XSLTProcessor->importStylesheet()

(no version information, might be only in CVS)

XSLTProcessor->importStylesheet() -- Import stylesheet

说明

class XSLTProcessor {

void importStylesheet ( DOMDocument stylesheet )

}

This method import the stylesheet into the XSLTProcessor for transformations.

参数

stylesheet

The imported style sheet as a DOMDocument object.

返回值

无返回值。


add a note add a note User Contributed Notes
bbrosseau at gmail
02-Mar-2005 12:46
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!