(PHP 5)
XSLTProcessor::setParameter — تعیین مقدار برای پارامتر
تعیین مقدار برای یک یا تعداد بیشتری پارامتر در تبدیلات بعدی با XSLTProcessor. اگر پارامتر در stylesheet موجود نباشد نادیده گرفته میشود.
فضای نام URI پارامتر XSLT.
نام محلی پارامتر XSLT.
مقدار جدید پارامتر XSLT.
آرایه جفتهای name => value. این دستور از PHP 5.1.0 موجود است.
Returns TRUE on success or FALSE on failure.
Example #1 تغییر مالک پیش از تبدیل
<?php
$collections = array(
'Marc Rutkowski' => 'marc',
'Olivier Parmentier' => 'olivier'
);
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// Configure the transformer
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl); // attach the xsl rules
foreach ($collections as $name => $file) {
// Load the XML source
$xml = new DOMDocument;
$xml->load('collection_' . $file . '.xml');
$proc->setParameter('', 'owner', $name);
$proc->transformToURI($xml, 'file:///tmp/' . $file . '.html');
}
?>