xslt_runSynopsis
DescriptionTakes a handle to a Sablotron parser and the URIs of a stylesheet and an XML document. The stylesheet transformation is applied to the data from the XML document and placed into the result buffer specified by result_URI . If no value is give for result_URI , then the default value of 'arg:/_result' will be used. xslt_parameters should contain a list of any variables to be passed to the stylesheet; xslt_arguments allows you to pass a list of named document buffers to the stylesheet. After a successful transformation, the resulting document may be retrieved using xslt_fetch_result() . ExampleExample 1145. Applying a stylesheet from one file to XML from another file <?php error_reporting(E_ALL); $xml_file = 'slashdot.xml'; $xsl_file = 'slashdot.xsl'; $xslt = xslt_create(); if (!xslt_run($xslt, $xsl_file, $xml_file)) { echo "xslt_run() failed\n"; } else { echo xslt_fetch_result($xslt); } xslt_closelog($xslt); xslt_free($xslt); ?>
PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing
(Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch).
This material may be distributed only subject to the terms and conditions set forth
in the Open Publication License, v1.0 or later (the latest version is presently available at
http://www.opencontent.org/openpub/).
The authors of this book have elected not to choose any options under the OPL. This online book was obtained
from http://www.fooassociates.com/phpfer/
and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4
for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All
persons and entities shall have neither liability nor responsibility to any person or entity with respect to
any loss or damage arising from the information contained in this book.
|