note 44494 added to function.xslt-process
| From: | ppekaar at hotmail dot com | Date: | Sun, 08 Aug 2004 00:19:48 +0000 |
| Subject: | note 44494 added to function.xslt-process | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-74179@lists.php.net to get a copy of this message | ||
In response to "twa at carlbro dot dk" above I have finally solved how to combine two XML
sources and one XSL stylesheet. The above comment was nearly right,
for the php
<?php
xh = xslt_create();
xslt_set_base($xh,"file://c:\inetpub\wwwroot\yourwebsite\");
$arguments = array('/_xml' => $xmlSingle, '/_xsl'=>$xsl,
'/xml2'=>$xml_rates);
$xslResult = xslt_process($xh, 'arg:/_xml', 'single_availability_filter.xsl',
NULL, $arguments,$parameters);
?>
Please note that I have put in a blank variable "/_xsl => $xsl", the actuall XSL file
is listed directly in the xslt_process fucntion.
Note that we have a third XML data source which is called xml2 and is set a value $xml_rates. In
your XSL stylesheet you can now call this XML data via the following line
<xsl:variable name="filter_rates"
select="document('arg:/xml2')/RackRates"/>
the missing link was putting in the the arg:/
Also please note that I am using xslt_set_base which set the base filepath for all your XSL
documents.
Hope this helps.
Phelim
----
Manual Page -- http://www.php.net/manual/en/function.xslt-process.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44494
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44494&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44494&report=yes
Search -- http://master.php.net/manage/user-notes.php