★ wanayoo — archive 1999 http://fr.php.net/manual/ja/function.xslt-process.phpNouvelle recherche | Portail wanayoo
PHP Sunday, March 11, 2001  
downloads | documentation | faq | support | reporting bugs | links 

search for in the  

lookup:
PHP マニュアルPHP マニュアル
XSLTXSLT
 xslt_closelogxslt_closelog
 xslt_createxslt_create
 xslt_errnoxslt_errno
 xslt_errorxslt_error
 xslt_fetch_resultxslt_fetch_result
 xslt_freexslt_free
 xslt_openlogxslt_openlog
 xslt_output_begintransformxslt_output_begintransform
 xslt_output_endtransformxslt_output_endtransform
 xslt_processxslt_process
 xslt_runxslt_run
 xslt_set_sax_handlerxslt_set_sax_handler
 xslt_transformxslt_transform

previousxslt_output_endtransform
xslt_runnext

Last updated: Mon, 05 Mar 2001
view this page in English | Brazilian Portuguese | Dutch | French | German | Hungarian | Italian | Japanese | Korean | Spanish | Plain HTML

xslt_process

(PHP 4 >= 4.0.3)

xslt_process -- XSLデータを有する文字列によりXMLデータを変換する

説明

bool xslt_process (string xsl_data string xml_data string result)

xslt_process() は、XSLT スタイルシートを有する 文字列を最初の引数、変換したいXMLデータを有する文字列を2番目の引 数、変換結果を有する文字列を3番目の引数とします。 xslt_process() は、成功時に true、失敗時に false を返します。エラーが発生した場合にエラー番号とエラー文字列 を得るには、関数 xslt_errno() および xslt_error() を使用して下さい。

例 1. 3つの文字列を変換するために xslt_process() を使用する


<?php

$xslData = '
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="article">
    <table border="1" cellpadding="2" cellspacing="1">
        <tr>
            <td width="20%">
              
            </title>
            <td width="80%">
                <h2><xsl:value-of select="title"></h2>
                <h3><xsl:value-of select="author"></h3>
                <br>
                
                <xsl:value-of select="body">
            </td>
        </tr>
    </table>
</xsl:template>

</xsl:stylesheet>';

$xmlData = '
<?xml version="1.0"?>
<article>
    <title>Learning German</title>
    <author>Sterling Hughes</author>
    <body>
      Essential phrases:
      <br>
      <br>
      Komme sie mir sagen, woe die toilette es?<br>
      Eine grande beer bitte!<br>
      Noch einem bitte.<br>
    </body>
</article>';

if (xslt_process($xslData, $xmlData, $result))
{
    echo "Here is the brilliant in-depth article on learning";
    echo " German: ";
    echo "<br>\n<br>";
    echo $result;
}
else
{
    echo "There was an error that occurred in the XSL transformation...\n";
    echo "\tError number: " . xslt_errno() . "\n";
    echo "\tError string: " . xslt_error() . "\n";
    exit;
}
?>
      

previousxslt_output_endtransform
xslt_runnext

Last updated: Mon, 05 Mar 2001
add note | about notes

show source | credits | mirror sites:  

Copyright © 1998-2001 The PHP Group
All rights reserved.
This mirror generously provided by: L'Université Michel de Montaigne Bordeaux III
Last updated: Sun Mar 11 08:55:03 2001 MET