[PHP-users 4309] Re: xslt_process 関数でエラー

Hidefumi OKUMURA php-users@php.gr.jp
Sat, 15 Dec 2001 08:04:45 +0900


はじめまして、奥村と申します。

At 01:07 01/12/15 +0900, you wrote:
>[環境]
> Windows2000SP2
> Apache1.3.22
> PHP4.1.0
>
>#そういえば、PHP4.1.0でphp_sabtlon.dllがなくなって
> しまいましたが、これが関係あるのでしょうか。
> php_xslt.dllは有効にしています。

間違っているかもしれませんが、もし PHP4.1.0 以前から xslt_process 
関数をお使いでしたら、PHP4.1.0 から関数の引数が増えているので、
変更すれば良いと思います。

下記は、PHP4.1.0 に含まれているドキュメントから引用しています。
---------------(ext/xslt/README.XSLT-BACKENDSから引用)
mixed xslt_process(resource processor,
                    string xml,
                                        string xsl[,
                                        string result[,
                                        array  arguments[,
                                        array  parameters]]])

 This function performs the magic, it takes the user's data, performs the
 transformation and depending on the context either saves the result to a file
 or returns the data to the user.

 To understand the way the xslt_process() function works, you must first
 understand the concept of "argument buffers".  Argument buffers are equivalent
 to the concept of symlinks on a Unix system, take the following example:

 <?php

 /**
  * $xml contains the contents of an XML file and $xsl contains
  * the contents of an XSLT stylesheet
  */
 $args = array("/_xml" => $xml,
               "/_xsl" => $xsl);

 $xh = xslt_create();
 $data = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args);
 xslt_free($xh);

 print( "The results of the transformation were\n" );
 print( "<br>\n<hr>\n<br>" );
 print( $data );
 print( "<br>\n<hr>\n<br>" );
 ?>
---------------(ext/xslt/README.XSLT-BACKENDSから引用)