hirokawa Sun Jan 27 09:48:15 2002 EDT Modified files: /phpdoc/ja/functions wddx.xml xml.xml xslt.xml yaz.xml zip.xml Log: translation updated.
Index: phpdoc/ja/functions/wddx.xml diff -u phpdoc/ja/functions/wddx.xml:1.9 phpdoc/ja/functions/wddx.xml:1.10 --- phpdoc/ja/functions/wddx.xml:1.9 Wed Dec 12 15:53:51 2001 +++ phpdoc/ja/functions/wddx.xml Sun Jan 27 09:48:14 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.10 $ --> <reference id="ref.wddx"> <title>WDDX 関数</title> <titleabbrev>WDDX</titleabbrev> @@ -23,51 +24,58 @@ <example> <title>単一の値のシリアル化</title> <programlisting role="php"> -<?php +<![CDATA[ +<?php print wddx_serialize_value("PHP to WDDX packet example", "PHP packet"); -?> +?> +]]> </programlisting> - </example></para> - + </example> + </para> <para> この例は次の出力を行います。 <informalexample> <programlisting role="php"> -<wddxPacket version='1.0'><header comment='PHP packet'/><data> -<string>PHP to WDDX packet example</string></data></wddxPacket> +<![CDATA[ +<wddxPacket version='1.0'><header comment='PHP packet'/><data> +<string>PHP to WDDX packet example</string></data></wddxPacket> +]]> </programlisting> </informalexample> <example> <title>パケットを追加する例</title> <programlisting role="php"> -<?php +<![CDATA[ +<?php $pi = 3.1415926; $packet_id = wddx_packet_start("PHP"); wddx_add_vars($packet_id, "pi"); -/* $cities はデータベースからのデータと仮定 */ +/* Suppose $cities came from database */ $cities = array("Austin", "Novato", "Seattle"); wddx_add_vars($packet_id, "cities"); $packet = wddx_packet_end($packet_id); print $packet; -?> +?> +]]> </programlisting> - </example></para> - + </example> + </para> <para> この例は次のような出力を行います。 - <informalexample> - <programlisting role="php"> -<wddxPacket version='1.0'><header comment='PHP'/><data><struct> -<var name='pi'><number>3.1415926</number></var><var name='cities'> -<array length='3'><string>Austin</string><string>Novato</string> -<string>Seattle</string></array></var></struct></data></wddxPacket> - </programlisting> - </informalexample></para> - + <screen> +<![CDATA[ +<wddxPacket version='1.0'><header comment='PHP'/><data><struct> +<var name='pi'><number>3.1415926</number></var><var name='cities'> +<array length='3'><string>Austin</string><string>Novato</string> +<string>Seattle</string></array></var></struct></data></wddxPacket> +]]> + </screen> + </informalexample> + </para> </partintro> <refentry id="function.wddx-serialize-value"> @@ -129,9 +137,10 @@ </para> <para> <example> - <title>wddx_serialize_vars の例</title> + <title><function>wddx_serialize_vars</function>の例</title> <programlisting> -<?php +<![CDATA[ +<?php $a = 1; $b = 5.5; $c = array("blue", "orange", "violet"); @@ -139,18 +148,21 @@ $clvars = array("c", "d"); print wddx_serialize_vars("a", "b", $clvars); -?> +?> +]]> </programlisting> </example> </para> <para> 上の例は、次の出力を行います。 - <programlisting> -<wddxPacket version='1.0'><header/><data><struct><var name='a'><number>1</number></var> -<var name='b'><number>5.5</number></var><var name='c'><array length='3'> -<string>blue</string><string>orange</string><string>violet</string></array></var> -<var name='d'><string>colors</string></var></struct></data></wddxPacket> - </programlisting> + <screen> +<![CDATA[ +<wddxPacket version='1.0'><header/><data><struct><var +name='a'><number>1</number></var> +<var name='b'><number>5.5</number></var><var name='c'><array length='3'> +<string>blue</string><string>orange</string><string>violet</string></array></var> +<var name='d'><string>colors</string></var></struct></data></wddxPacket> +]]> + </screen> </para> </refsect1> </refentry> Index: phpdoc/ja/functions/xml.xml diff -u phpdoc/ja/functions/xml.xml:1.15 phpdoc/ja/functions/xml.xml:1.16 --- phpdoc/ja/functions/xml.xml:1.15 Wed Dec 12 15:53:51 2001 +++ phpdoc/ja/functions/xml.xml Sun Jan 27 09:48:14 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.16 $ --> <reference id="ref.xml"> <title>XML パーサ関数</title> <titleabbrev>XML</titleabbrev> @@ -25,9 +26,11 @@ 付属のMakefileは、デフォルトでライブラリを構築しません。これを行 うmakeルールを次のように指定できます。 <programlisting role="makefile"> +<![CDATA[ libexpat.a: $(OBJS) - ar -rc $@ $(OBJS) - ranlib $@ + ar -rc $@ $(OBJS) + ranlib $@ +]]> </programlisting> expat のソース RPM パッケージが <ulink url="&url.expat.rpm;">&url.expat.rpm;</ulink> にあります。 @@ -276,12 +279,13 @@ <example> <title>XML エレメント構造を表示</title> <programlisting role="php"> +<![CDATA[ $file = "data.xml"; $depth = array(); function startElement($parser, $name, $attrs){ global $depth; - for ($i = 0; $i < $depth[$parser]; $i++) { + for ($i = 0; $i < $depth[$parser]; $i++) { print " "; } print "$name\n"; @@ -306,7 +310,7 @@ } } xml_parser_free($xml_parser); - +]]> </programlisting> </example> </para> @@ -322,24 +326,25 @@ "map array" にないエレメントは無視されます。もちろん、この例は、 特定の XML ドキュメント型を有する場合のみ動作します。 <programlisting role="php"> +<![CDATA[ $file = "data.xml"; $map_array = array( - "BOLD" => "B", - "EMPHASIS" => "I", - "LITERAL" => "TT" + "BOLD" => "B", + "EMPHASIS" => "I", + "LITERAL" => "TT" ); function startElement($parser, $name, $attrs){ global $map_array; if ($htmltag = $map_array[$name]) { - print "<$htmltag>"; + print "<$htmltag>"; } } function endElement($parser, $name){ global $map_array; if ($htmltag = $map_array[$name]) { - print "</$htmltag>"; + print "</$htmltag>"; } } @@ -363,6 +368,7 @@ } } xml_parser_free($xml_parser); +]]> </programlisting> </para> </example> @@ -386,33 +392,35 @@ <example> <title>外部エンティティの例</title> <programlisting role="php"> +<![CDATA[ $file = "xmltest.xml"; function trustedFile($file){ // 自己所有のローカルファイルのみを信頼する - if (!eregi("^([a-z]+)://", $file) && fileowner($file) == getmyuid()) { + if (!eregi("^([a-z]+)://", $file) + && fileowner($file) == getmyuid()) { return true; } return false; } function startElement($parser, $name, $attribs){ - print "&lt;<font color=\"#0000cc\">$name</font>"; + print "<<font color=\"#0000cc\">$name</font>"; if (sizeof($attribs)) { while (list($k, $v) = each($attribs)) { - print " <font color=\"#009900\">$k</font>=\"<font - color=\"#990000\">$v</font>\""; + print " <font color=\"#009900\">$k</font>=\"<font + color=\"#990000\">$v</font>\""; } } - print "&gt;"; + print ">"; } function endElement($parser, $name){ - print "&lt;/<font color=\"#0000cc\">$name</font>&gt;"; + print "</<font color=\"#0000cc\">$name</font>>"; } function characterData($parser, $data){ - print "<b>$data</b>"; + print "<b>$data</b>"; } function PIHandler($parser, $target, $data){ @@ -425,17 +433,20 @@ if (trustedFile($parser_file[$parser])) { eval($data); } else { - printf("Untrusted PHP code: <i>%s</i>", htmlspecialchars($data)); + printf("Untrusted PHP code: <i>%s</i>", + htmlspecialchars($data)); } break; } } function defaultHandler($parser, $data){ - if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") { - printf('<font color="#aa00aa">%s</font>', htmlspecialchars($data)); + if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";") { + printf('<font color="#aa00aa">%s</font>', + htmlspecialchars($data)); } else { - printf('<font size="-1">%s</font>', htmlspecialchars($data)); + printf('<font size="-1">%s</font>', + htmlspecialchars($data)); } } @@ -488,7 +499,7 @@ die("could not open XML input"); } -print "<pre>"; +print "<pre>"; while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d\n", @@ -496,12 +507,12 @@ xml_get_current_line_number($xml_parser))); } } -print "</pre>"; +print "</pre>"; print "parse complete\n"; xml_parser_free($xml_parser); ?> - +]]> </programlisting> </example> </para> @@ -509,33 +520,35 @@ <example> <title>xmltest.xml</title> <programlisting role="xml"> -<?xml version='1.0'?> -<!DOCTYPE chapter SYSTEM "/just/a/test.dtd" [ -<!ENTITY plainEntity "FOO entity"> -<!ENTITY systemEntity SYSTEM "xmltest2.xml"> -]> -<chapter> - <TITLE>Title &plainEntity;</TITLE> - <para> - <informaltable> - <tgroup cols="3"> - <tbody> - <row><entry>a1</entry><entry morerows="1">b1</entry><entry>c1</entry></row> - <row%gt;<entry>a2</entry><entry>c2</entry></row> - <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> - </tbody> - </tgroup> - </informaltable> - </para> - &systemEntity; - <sect1 id="about"> - <title>About this Document</title> - <para> - <!-- this is a comment --> - <?php print 'Hi! This is PHP version '.phpversion(); ?> - </para> - </sect1> -</chapter> +<![CDATA[ +<?xml version='1.0'?> +<!DOCTYPE chapter SYSTEM "/just/a/test.dtd" [ +<!ENTITY plainEntity "FOO entity"> +<!ENTITY systemEntity SYSTEM "xmltest2.xml"> +]> +<chapter> + <TITLE>Title &plainEntity;</TITLE> + <para> + <informaltable> + <tgroup cols="3"> + <tbody> + <row><entry>a1</entry><entry morerows="1">b1</entry><entry>c1</entry></row> + <row><entry>a2</entry><entry>c2</entry></row> + <row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row> + </tbody> + </tgroup> + </informaltable> + </para> + &systemEntity; + <sect1 id="about"> + <title>About this Document</title> + <para> + <!-- this is a comment --> + <?php print 'Hi! This is PHP version '.phpversion(); ?> + </para> + </sect1> +</chapter> +]]> </programlisting> </example> </para> @@ -544,15 +557,17 @@ <example> <title>xmltest2.xml</title> <programlisting role="xml"> -<?xml version="1.0"?> -<!DOCTYPE foo [ -<!ENTITY testEnt "test entity"> +<![CDATA[ +<?xml version="1.0"?> +<!DOCTYPE foo [ +<!ENTITY testEnt "test entity"> ]> -<foo> - <element attrib="value"/> - &testEnt; - <?php print "This is some more PHP code being executed."; ?> -</foo> +<foo> + <element attrib="value"/> + &testEnt; + <?php print "This is some more PHP code being executed."; ?> +</foo> +]]> </programlisting> </example> </para> @@ -622,38 +637,40 @@ のメソッドであると仮定されます。 </para> <programlisting role="php"> -<?php +<![CDATA[ +<?php class xml { var $parser; function xml() { $this->parser = xml_parser_create(); - xml_set_object($this->parser,&$this); + xml_set_object($this->parser,&$this); xml_set_element_handler($this->parser,"tag_open","tag_close"); xml_set_character_data_handler($this->parser,"cdata"); } - + function parse($data) { xml_parse($this->parser,$data); } - + function tag_open($parser,$tag,$attributes) { var_dump($parser,$tag,$attributes); } - + function cdata($parser,$cdata) { - var_dump($parser,$cdata); - } - + var_dump($parser,$cdata); +} + function tag_close($parser,$tag) { var_dump($parser,$tag); } - -} // クラス xmlの終わり - + +} // end of class xml + $xml_parser = new xml(); -$xml_parser->parse("<A ID=\"hallo\">PHP</A>"); +$xml_parser->parse("<A ID=\"hallo\">PHP</A>"); ?> +]]> </programlisting> </refsect1> </refentry> @@ -780,11 +797,7 @@ <parameter>parser</parameter>がパーサでない場合に &false;が返されます。 </para> - <para> - オブジェクト/メソッドのハンドラは現在サポートされていません。 - オブジェクト内でのXMLパーサの使用法については、 - <function>xml_set_object</function> を参照下さい。 - </para> + ¬e.func-callback; </refsect1> </refentry> @@ -878,10 +891,11 @@ </funcprototype> </funcsynopsis> <para> - XML パーサ <parameter>parser</parameter> の処理命令 (PI) 用ハンド - ラ関数を設定しますり <parameter>handler</parameter>は、<parameter>parser</parameter> - に関して<function>xml_parse</function>がコールされた際に必要な関 - 数の名前を有する文字列です。 + XML パーサ <parameter>parser</parameter>の処理命令 (PI)用ハンドラ + 関数を設定します。<parameter>handler</parameter>は、 + <parameter>parser</parameter>に関して + <function>xml_parse</function>がコールされた際に必要な関数の名前 + を有する文字列です。 </para> <para> 処理命令は、次のフォーマットを有しています。 @@ -945,14 +959,11 @@ 定されている場合、そのハンドラ無効です。 </para> <para> - ハンドラが設定されている場合に&true;、<parameter>parser</parameter> - がパーサでない場合に&false;が返されます。 - </para> - <para> - オブジェクト/メソッドのハンドラは現在サポートされていません。 - オブジェクト内でのXMLパーサの使用法については、 - <function>xml_set_object</function>を参照下さい。 + ハンドラが設定されている場合に&true;、 + <parameter>parser</parameter>がパーサでない場合に&false;が返され + ます。 </para> + ¬e.func-callback; </refsect1> </refentry> @@ -1018,11 +1029,7 @@ ハンドラが設定されている場合に&true;、<parameter>parser</parameter> がパーサでない場合に&false;が返されます。 </para> - <para> - オブジェクト/メソッドのハンドラは現在サポートされていません。 - オブジェクト内でのXMLパーサの使用法については、 - <function>xml_set_object</function>を参照下さい。 - </para> + ¬e.func-callback; </refsect1> </refentry> @@ -1141,11 +1148,7 @@ ハンドラが設定されている場合に&true;、<parameter>parser</parameter> がパーサでない場合に&false;を返します。 </para> - <para> - オブジェクト/メソッド用ハンドラは現在サポートされていません。 - オブジェクト内でのXMLパーサの使用法については、 - <function>xml_set_object</function>を参照下さい。 - </para> + ¬e.func-callback; </refsect1> </refentry> @@ -1174,11 +1177,13 @@ <para> 表記法の宣言は、ドキュメントの DTD の部分であり、次のようなフォー マットを有しています。 - <programlisting role="xml" - ><!NOTATION <parameter>name</parameter - > {<parameter>systemId</parameter - > | <parameter>publicId</parameter - >}></programlisting> + <programlisting role="xml"> +<!NOTATION <parameter>name</parameter> { + <parameter>systemId</parameter> | + <parameter>publicId</parameter> + } +> + </programlisting> 表記法宣言の定義に関しては、 <ulink url="&url.rec-xml;#Notations">XML 1.0 仕様の 4.7 節</ulink> を参照下さい。 @@ -1251,11 +1256,7 @@ ハンドラが設定されている場合に&true;、<parameter>parser</parameter> がパーサでない場合に&false;を返します。 </para> - <para> - オブジェクト/メソッド用ハンドラは現在サポートされていません。 - オブジェクト内でのXMLパーサの使用法については、 - <function>xml_set_object</function>を参照下さい。 - </para> + ¬e.func-callback; </refsect1> </refentry> @@ -1360,11 +1361,7 @@ <parameter>parser</parameter> がパーサでない場合に&false;が 返されます。 </para> - <para> - オブジェクト/メソッド用ハンドラは現在サポートされていません。 - オブジェクト内でのXMLパーサの使用法については、 - <function>xml_set_object</function>を参照下さい。 - </para> + ¬e.func-callback; </refsect1> </refentry> @@ -1640,7 +1637,8 @@ め込んで使用した後、これをパースし、生成された構造体を出力します。 <informalexample> <programlisting role="php"> -$simple = "<para><note>simple note</note></para>"; +<![CDATA[ +$simple = "<para><note>simple note</note></para>"; $p = xml_parser_create(); xml_parse_into_struct($p,$simple,$vals,$index); xml_parser_free($p); @@ -1648,23 +1646,25 @@ print_r($index); echo "\nVals array\n"; print_r($vals); +]]> </programlisting> </informalexample> このコードを実行した場合、出力は次のようになります。 <informalexample> - <programlisting> + <screen> +<![CDATA[ Index array Array ( - [PARA] => Array + [PARA] => Array ( - [0] => 0 - [1] => 2 + [0] => 0 + [1] => 2 ) - [NOTE] => Array + [NOTE] => Array ( - [0] => 1 + [0] => 1 ) ) @@ -1672,30 +1672,31 @@ Vals array Array ( - [0] => Array + [0] => Array ( - [tag] => PARA - [type] => open - [level] => 1 + [tag] => PARA + [type] => open + [level] => 1 ) - [1] => Array + [1] => Array ( - [tag] => NOTE - [type] => complete - [level] => 2 - [value] => simple note + [tag] => NOTE + [type] => complete + [level] => 2 + [value] => simple note ) - [2] => Array + [2] => Array ( - [tag] => PARA - [type] => close - [level] => 1 + [tag] => PARA + [type] => close + [level] => 1 ) ) - </programlisting> +]]> + </screen> </informalexample> </para> <para> @@ -1708,25 +1709,27 @@ す。 <example> <title>moldb.xml - 分子情報の小さなデータベース</title> - <programlisting> -<?xml version="1.0"?> -<moldb> - - <molecule> - <name>Alanine</name> - <symbol>ala</symbol> - <code>A</code> - <type>hydrophobic</type> - </molecule> - - <molecule> - <name>Lysine</name> - <symbol>lys</symbol> - <code>K</code> - <type>charged</type> - </molecule> + <programlisting role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<moldb> + + <molecule> + <name>Alanine</name> + <symbol>ala</symbol> + <code>A</code> + <type>hydrophobic</type> + </molecule> + + <molecule> + <name>Lysine</name> + <symbol>lys</symbol> + <code>K</code> + <type>charged</type> + </molecule> -</moldb> +</moldb> +]]> </programlisting> </example> ドキュメントを処理し、適当なオブジェクトを生成するいくつかのコー @@ -1737,58 +1740,60 @@ 入 </title> <programlisting role="php"> -<?php +<![CDATA[ +<?php class AminoAcid { - var $name; // aa の名前 - var $symbol; // 3文字のシンボル - var $code; // 1文字の文字コード - var $type; // hydrophobic, charged or neutral - - function AminoAcid ($aa) { - foreach ($aa as $k=>$v) - $this->$k = $aa[$k]; - } + var $name; // aa name + var $symbol; // three letter symbol + var $code; // one letter code + var $type; // hydrophobic, charged or neutral + + function AminoAcid ($aa) { + foreach ($aa as $k=>$v) + $this->$k = $aa[$k]; + } } function readDatabase($filename) { - // アミノ酸のXMLデータベースの読み込み - $data = implode("",file($filename)); - $parser = xml_parser_create(); - xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); - xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); - xml_parse_into_struct($parser,$data,$values,$tags); - xml_parser_free($parser); - - // 構造体を処理するループ - foreach ($tags as $key=>$val) { - if ($key == "molecule") { - $molranges = $val; - // each contiguous pair of array entries are the - // lower and upper range for each molecule definition - for ($i=0; $i < count($molranges); $i+=2) { - $offset = $molranges[$i] + 1; - $len = $molranges[$i + 1] - $offset; - $tdb[] = parseMol(array_slice($values, $offset, $len)); - } - } else { - continue; - } - } - return $tdb; + // read the xml database of aminoacids + $data = implode("",file($filename)); + $parser = xml_parser_create(); + xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); + xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); + xml_parse_into_struct($parser,$data,$values,$tags); + xml_parser_free($parser); + + // loop through the structures + foreach ($tags as $key=>$val) { + if ($key == "molecule") { + $molranges = $val; + // each contiguous pair of array entries are the + // lower and upper range for each molecule definition + for ($i=0; $i < count($molranges); $i+=2) { + $offset = $molranges[$i] + 1; + $len = $molranges[$i + 1] - $offset; + $tdb[] = parseMol(array_slice($values, $offset, $len)); + } + } else { + continue; + } + } + return $tdb; } function parseMol($mvalues) { - for ($i=0; $i < count($mvalues); $i++) - $mol[$mvalues[$i]["tag"]] = $mvalues[$i]["value"]; - return new AminoAcid($mol); + for ($i=0; $i < count($mvalues); $i++) + $mol[$mvalues[$i]["tag"]] = $mvalues[$i]["value"]; + return new AminoAcid($mol); } -$db = readDatabase("moldb.xml"); +$db = readDatabase("moldb.xml"); echo "** Database of AminoAcid objects:\n"; print_r($db); -?> +?> +]]> </programlisting> </example> <filename>parsemoldb.php</filename>を実行した後、変数 @@ -1796,28 +1801,30 @@ <classname>AminoAcid</classname>の配列を有しており、スクリプトの 出力は、次のようになります。 <informalexample> - <programlisting> + <screen> +<![CDATA[ ** Database of AminoAcid objects: Array ( - [0] => aminoacid Object + [0] => aminoacid Object ( - [name] => Alanine - [symbol] => ala - [code] => A - [type] => hydrophobic + [name] => Alanine + [symbol] => ala + [code] => A + [type] => hydrophobic ) - [1] => aminoacid Object + [1] => aminoacid Object ( - [name] => Lysine - [symbol] => lys - [code] => K - [type] => charged + [name] => Lysine + [symbol] => lys + [code] => K + [type] => charged ) ) - </programlisting> +]]> + </screen> </informalexample> </para> </refsect1> @@ -1933,8 +1940,8 @@ <function>xml_parser_create</function> により使用されたソース エンコーディングと同じエンコーディングが設定されます。 サポートされるターゲットエンコーディングは、 - <literal>ISO-8859-1</literal>, <literal>US-ASCII</literal> - ,<literal>UTF-8</literal> です。 + <literal>ISO-8859-1</literal>, <literal>US-ASCII</literal>, + <literal>UTF-8</literal> です。 </entry> </row> </tbody> @@ -2081,6 +2088,76 @@ 各 <replaceable>b</replaceable> は、文字列データを保存可能なビッ トを示します。 </para> + </refsect1> + </refentry> + + <refentry id='function.xml-parser-create-ns'> + <refnamediv> + <refname>xml_parser_create_ns</refname> + <refpurpose>XMLパーサを生成する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>xml_parser_create_ns</function></funcdef> + <paramdef>string + <parameter><optional>encoding</optional></parameter> + </paramdef> + <paramdef>string + <parameter><optional>sep</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.xml-set-end-namespace-decl-handler'> + <refnamediv> + <refname>xml_set_end_namespace_decl_handler</refname> + <refpurpose>名前空間終了ハンドラを設定する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int + <function>xml_set_end_namespace_decl_handler</function> + </funcdef> + <paramdef>int <parameter>pind</parameter></paramdef> + <paramdef>string <parameter>hdl</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + ¬e.func-callback; + </refsect1> + </refentry> + + <refentry id='function.xml-set-start-namespace-decl-handler'> + <refnamediv> + <refname>xml_set_start_namespace_decl_handler</refname> + <refpurpose>名前空間開始ハンドラを設定する</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int + <function>xml_set_start_namespace_decl_handler</function> + </funcdef> + <paramdef>int <parameter>pind</parameter></paramdef> + <paramdef>string <parameter>hdl</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + ¬e.func-callback; </refsect1> </refentry> Index: phpdoc/ja/functions/xslt.xml diff -u phpdoc/ja/functions/xslt.xml:1.11 phpdoc/ja/functions/xslt.xml:1.12 --- phpdoc/ja/functions/xslt.xml:1.11 Wed Dec 12 15:53:53 2001 +++ phpdoc/ja/functions/xslt.xml Sun Jan 27 09:48:14 2002 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.12 $ --> <reference id="ref.xslt"> <title>XSLT 関数</title> <titleabbrev>XSLT</titleabbrev> <partintro> - &warn.experimental; <sect1 id="xslt.partintro"> <title>導入</title> @@ -30,8 +30,8 @@ </para> <para> UNIXでは、オプション <option - role="configure">--with-sablot</option> を指定して - <command>configure</command> を実行します。ライブラリ + role="configure">--enable-xslt --with-xslt-sablot</option>を指定 + して<command>configure</command> を実行します。ライブラリ <productname>Sablotron</productname> をコンパイラが見付けられる 場所にインストールする必要があります。 </para> @@ -40,51 +40,90 @@ <sect2 id="xslt.about"> <title>この拡張モジュールについて</title> <para> - この PHP 拡張モジュールは、Ginger Alliance が開発した - <productname>Sablotron</productname> のサポートを PHP に実装しま - す。このツールキットにより XMLドキュメントを新しいXMLドキュメン - トを含む他のドキュメントに変換することが可能になります。この出力 - フォーマットには、HTMLまたは他のターゲットフォーマットも含まれま - す。XSLTは、基本的にWebサイトのコンテンツとデザインを分離する標 - 準化され、ポータブルなテンプレート機構を提供するものです。 + +このPHP拡張モジュールは、APIに独立なXSLT変換を提供します。現在、 + この拡張モジュールは、Ginger +AllianceによるSablotronライブラリの + +みをサポートします。Xalanライブラリまたはlibxsltライブラリのよう + な他のライブラリのサポートも計画されています。 </para> + <note> + <simpara> + この拡張は、PHP 4.1より前のバージョンPHPで配布されていた + sablotron拡張モジュールとは異なっており、現在、PHP +4.1の新しい + +XSLT拡張モジュールのみがサポートされています。古い拡張モジュー + ルのサポートが必要な場合は、メーリングリスト + [EMAIL PROTECTED]に質問して下さい。 + </simpara> + </note> </sect2> </sect1> </partintro> - <refentry id="function.xslt-closelog"> + <refentry id="function.xslt-set-log"> <refnamediv> - <refname>xslt_closelog</refname> - <refpurpose> - 指定した Sablotron インスタンス用のログファイルをクリアする - </refpurpose> + <refname>xslt_set_log</refname> + <refpurpose>Set the log file to write log messages to</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>bool <function>xslt_closelog</function></funcdef> + <funcdef>void <function>xslt_set_log</function></funcdef> <paramdef>resource <parameter>xh</parameter></paramdef> + <paramdef>mixed <parameter>log</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> <variablelist> <varlistentry> <term><parameter>xh</parameter></term> <listitem> - <simpara> - XSLT パーサへのリファレンス。 - </simpara> + <simpara> + A reference to the XSLT parser. + </simpara> </listitem> </varlistentry> - </variablelist> + <varlistentry> + <term><parameter>log</parameter></term> + <listitem> + <simpara> + This parameter is either a boolean value which toggles logging on and off, or a + string containing the logfile in which log errors too. + </simpara> + </listitem> + </varlistentry> + </variablelist></para> + <para> + This function allows you to set the file in which you want XSLT log messages to, + XSLT log messages are different than error messages, in that log messages are not + actually error messages but rather messages related to the state of the XSLT +processor. + They are useful for debugging XSLT, when something goes wrong. </para> <para> - この関数は、<parameter>parser</parameter> が有効なパーサを参照し - ないか、ログファイルをクローズに失敗した場合に &false; を返します。 - その他の場合に &true; を返します。 + By default logging is disabled, in order to enable logging you must first call + <function>xslt_set_log</function> with a boolean parameter which enables logging, +then if + you want to set the log file to debug to, you must then pass it a string +containing the + filename: + <example> + <title> + Using the XSLT Logging features + </title> + <programlisting role="php"> +<![CDATA[ +<?php + +$xh = xslt_create(); +xslt_set_log($xh, true); +xslt_set_log($xh, getcwd() . 'myfile.log'); + +$result = xslt_process($xh, 'dog.xml', 'pets.xsl'); +print($result); + +xslt_free($xh); +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> @@ -102,10 +141,9 @@ <void/> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - この関数は、新規のXSLTプロセッサへのハンドルを返します。このハン - ドルは、この後に使用する全てのXSLT関数をコールする際に必要です。 + +新規にXSLTプロセッサリソースを作成し、返します。このリソースは、 + 他のXSLT関数による処理で使用されます。 </para> </refsect1> </refentry> @@ -123,11 +161,9 @@ <paramdef>resource <parameter>xh</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - 指定したXSLTプロセッサについてカレントのエラー番号を返します。ハ - ンドルが指定されていない場合、どこかで発生した直近のエラー番号が - 返されます。 + +XSLTプロセッサで発生した直近のエラーを記述するエラーコードを返し + ます。 </para> </refsect1> </refentry> @@ -145,327 +181,425 @@ <paramdef>resource <parameter>xh</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - 指定したXSLTプロセッサについてカレントのエラー文字列を返します。 - ハンドラが指定されない場合、どこかで発生した直近のエラー文字列が - 返されます。 + +指定したXSLTプロセッサで発生した直近のエラーを説明する文字列を返 + します。 + </para> + <para> + <example> + <title> + 関数<function>xslt_error</function>および + <function>xslt_errno</function>を用いてエラーを処理する + </title> + <programlisting role="php"> +<![CDATA[ +<?php + +$xh = xslt_create(); +$result = xslt_process($xh, 'dog.xml', 'pets.xsl'); +if (!$result) { + die(sprintf("Cannot process XSLT document [%d]: %s", + xslt_errno($xh), xslt_error($xh))); +} + +print($result); + +xslt_free($xh); +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> - <refentry id="function.xslt-fetch-result"> + <refentry id="function.xslt-free"> <refnamediv> - <refname>xslt_fetch_result</refname> - <refpurpose>(名前のある)結果バッファを取得する</refpurpose> + <refname>xslt_free</refname> + <refpurpose>XSLT プロセッサを開放する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>string <function>xslt_fetch_result</function></funcdef> - <paramdef>resource <parameter>xh</parameter></paramdef> - <paramdef>string <parameter>result_name</parameter></paramdef> + <funcdef>void <function>xslt_free</function></funcdef> + <paramdef>resource <parameter>xh</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - ハンドルにより指定したXSLTプロセッサから結果バッファを取得します。 - <parameter>result_name</parameter> が指定されない場合、 - "/_result" という名前のバッファが取得されます。 + ハンドルで指定したXSLTプロセッサを開放します。 </para> </refsect1> </refentry> - <refentry id="function.xslt-free"> + <refentry id="function.xslt-process"> <refnamediv> - <refname>xslt_free</refname> - <refpurpose>XSLT プロセッサを開放する</refpurpose> + <refname>xslt_process</refname> + +<refpurpose>XSLデータを有する文字列によりXMLデータを変換する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>void <function>xslt_free</function></funcdef> - <paramdef>resource <parameter>xh</parameter></paramdef> + <funcdef>mixed + <function>xslt_process</function> + </funcdef> + <paramdef>resource <parameter>xh</parameter></paramdef> + <paramdef>string <parameter>xml</parameter></paramdef> + <paramdef>string <parameter>xsl</parameter></paramdef> + <paramdef>string + <parameter><optional>result</optional></parameter> + </paramdef> + <paramdef>array + <parameter><optional>arguments</optional></parameter> + </paramdef> + <paramdef>array + <parameter><optional>parameters</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - ハンドルで指定したXSLTプロセッサを開放します。 + <function>xslt_process</function>関数は、新規XSLT拡張の中心関数で + +す。引数バッファの概念により、ほとんど全ての型の入力ソースを用い + てXSLT変換を実行可能です。引数バッファは、Sablotron +XSLTプロセッ + +サ(現在、この拡張モジュールがサポートする惟一のXSLTプロセッサ)か + ら得た概念です。 + </para> + <para> + <function>xslt_process</function>関数で変換する最も簡単な方法は、 + +XMLファイルをXSLTファイルで変換し、結果を新しいXMLドキュメント(ま + +たはHTMLドキュメント)を含む3番目のファイルに出力することです。 + これをsablotronを行うのは、かなり簡単です。 + </para> + <example> + <title> + +XMLファイルとXSLファイルを新規XMLファイルに変換するために + <function>xslt_process</function>を使用する + </title> + <programlisting role="php"> +<![CDATA[ +<?php + +// Allocate a new XSLT processor +$xh = xslt_create(); + +// Process the document +if (xslt_process($xh, 'sample.xml', 'sample.xsl', 'result.xml')) { + print "SUCCESS, sample.xml was transformed by sample.xsl into result.xml"; + print ", result.xml has the following contents\n<br>\n"; + print "<pre>\n"; + readfile('result.xml'); + print "</pre>\n"; +} +else { + print "Sorry, sample.xml could not be transformed by sample.xsl into"; + print " result.xml the reason is that " . xslt_error($xh) . " and the "; + print "error code is " . xslt_errno($xh); +} + +xslt_free($xh); + +?> +]]> + </programlisting> + </example> + <para> + +この機能は優れていますが、特にWeb環境では、結果を直接出力したい場 + 合があります。そこで、<function>xslt_process</function>の3番目の + +引数を省略した場合(またはその引数にNULL値を指定した場合)、ファイ + +ルに書き込む替わりに自動的にXSLT変換後の出力を返します。 + </para> + <para> + <example> + <title> + +XMLファイルとXSLファイルを結果XMLデータを含む変数に変換するため + に<function>xslt_process</function>を使用する + </title> + <programlisting role="php"> +<![CDATA[ +<?php + +// Allocate a new XSLT processor +$xh = xslt_create(); + +// Process the document, returning the result into the $result variable +$result = xslt_process($xh, 'sample.xml', 'sample.xsl'); +if ($result) { + print "SUCCESS, sample.xml was transformed by sample.xsl into the \$result"; + print " variable, the \$result variable has the following contents\n<br>\n"; + print "<pre>\n"; + print $result; + print "</pre>\n"; +} +else { + print "Sorry, sample.xml could not be transformed by sample.xsl into"; + print " the \$result variable the reason is that " . xslt_error($xh) . + print " and the error code is " . xslt_errno($xh); +} + +xslt_free($xh); + +?> +]]> + </programlisting> + </example> + </para> + <para> + +上の二つのケースは、XSLT変換の最も簡単な場合です。これは、多くの + +場合には通用しますが、時々、データベースまたはソケットのような外 + +部ソースからXMLとXSLTコードを取得する場合があります。このような場 + 合、XMLまたはXSLTデータを変数に有することになります。 + +実用アプリケーションでは、これらをファイルにダンプする際のオーバー + ヘッドは大きいと言えます。このような場合こそ、XSLT + "argument" 構文が役に立ちます。 + <function>xslt_process</function>関数のXMLおよびXSLT引数としてファ + イルの替わりに引数配列(<function>xslt_process</function>関数の5番 + 目のパラメータ)で指定した値に置換される"argument place + holders"を指定することが可能です。 + +以下にファイルを全く使用せずにXMLおよびXSLTを結果変数に処理する例 + を示します。 + </para> + <para> + <example> + <title> + +XMLデータを含む変数とXSLTデータを含む変数をXMLデータ出力結果を + 含む変数に変換するために<function>xslt_process</function>を使用 + する + </title> + <programlisting role="php"> +<![CDATA[ +<?php +// $xml and $xsl contain the XML and XSL data + +$arguments = array( + '/_xml' => $xml, + '/_xsl' => $xsl +); + +// Allocate a new XSLT processor +$xh = xslt_create(); + +// Process the document +$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); +if ($result) { + print "SUCCESS, sample.xml was transformed by sample.xsl into the \$result"; + print " variable, the \$result variable has the following contents\n<br>\n"; + print "<pre>\n"; + print $result; + print "</pre>\n"; +} +else { + print "Sorry, sample.xml could not be transformed by sample.xsl into"; + print " the \$result variable the reason is that " . xslt_error($xh) . + print " and the error code is " . xslt_errno($xh); +} +xslt_free($xh); +?> +]]> + </programlisting> + </example> + </para> + <para> + 最後に、<function>xslt_process</function>関数の最後の引数は、XSLT + +ドキュメントに渡したいあらゆる引数です。これらのパラメータは、 + <xsl:param name="parameter_name">命令を用いて + XSLファイルの中でアクセスすることが可能です。 </para> </refsect1> </refentry> - <refentry id="function.xslt-openlog"> + <refentry id="function.xslt-set-sax-handler"> <refnamediv> - <refname>xslt_openlog</refname> - <refpurpose> - XSLTプロセッサのメッセージ用のログファイルを設定する - </refpurpose> + <refname>xslt_set_sax_handler</refname> + <refpurpose>XSLTプロセッサに SAX ハンドラを設定する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>bool <function>xslt_openlog</function></funcdef> + <funcdef>void <function>xslt_set_sax_handler</function></funcdef> <paramdef>resource <parameter>xh</parameter></paramdef> - <paramdef>string <parameter>logfile</parameter></paramdef> - <paramdef>int <parameter>loglevel</parameter></paramdef> + <paramdef>array <parameter>handlers</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - XSLT プロセッサのエラーメッセージを全て記録するログファイルを設定 - します。 + <parameter>xh</parameter>で指定したリソースハンドルにSAX +ハンドラ + +を設定します。SAXハンドラは、フォーマットの2次元配列とする必要が + あります。(全てのトップレベル要素はオプションです) + <informalexample> + <programlisting role="php"> +<![CDATA[ +array( +[document] => + array( + start document handler, + end document handler + ), +[element] => + array( + start element handler, + end element handler + ), +[namespace] => + array( + start namespace handler, + end namespace handler + ), +[comment] => comment handler, +[pi] => processing instruction handler, +[character] => character data handler +) +]]> + </programlisting> + </informalexample> </para> </refsect1> </refentry> - <refentry id="function.xslt-output-begintransform"> + <refentry id="function.xslt-set-scheme-handler"> <refnamediv> - <refname>xslt_output_begintransform</refname> - <refpurpose>出力の XSLT 変換を開始する</refpurpose> + <refname>xslt_set_scheme_handler</refname> + +<refpurpose>XSLTプロセッサ用にスキーマハンドラを設定する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>void - <function>xslt_output_begintransform</function> - </funcdef> - <paramdef>string <parameter>xslt_filename</parameter></paramdef> + <funcdef>void <function>xslt_set_scheme_handler</function></funcdef> + <paramdef>resource <parameter>xh</parameter></paramdef> + <paramdef>array <parameter>handlers</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; - <para> - この関数は、データ出力の変換を開始します。 - <function>xslt_output_begintransform</function> をコールした場所 - から、<function>xslt_output_endtransform</function> をコールした - 場所まで、最初の引数で指定したXSLTスタイルシートにより全ての出力 - は変換されます。 - </para> <para> - <example> - <title> - XSLTスタイルシートによる出力の変換、xml 生成用にDOM-XML関数を使 - 用する - </title> + +<parameter>xh</parameter>で指定したリソースハンドルにスキーマハン + +ドラを設定します。スキーマハンドラは、フォーマットの配列とする必 + 要があります。(全ての要素はオプションです) + <informalexample> <programlisting role="php"> -<?php - -$xsl_file = "article.xsl"; -xslt_output_begintransform($xsl_file); - -$doc = new_xmldoc('1.0'); -$article = $doc->new_root('article'); - -$article->new_child('title', 'The History of South Tyrol'); -$article->new_child('author', 'Sterling Hughes'); -$article->new_child('body', 'Back after WWI, Italy gained South Tyrol from - Austria. Since that point nothing interesting has - happened'); - -echo $doc->dumpmem(); - -xslt_output_endtransform(); - </programlisting> - </example> +<![CDATA[ +array( +[get_all] => get all handler, +[open] => open handler, +[get] => get handler, +[put] => put handler, +[close] => close handler +) +]]> + </programlisting> + </informalexample> </para> </refsect1> </refentry> - <refentry id="function.xslt-output-endtransform"> + <refentry id="function.xslt-set-error-handler"> <refnamediv> - <refname>xslt_output_endtransform</refname> - <refpurpose> - xslt_output_begintransformで開始した出力の変換を終了する - </refpurpose> + <refname>xslt_set_error_handler</refname> + +<refpurpose>XSLTプロセッサ用のエラーハンドラを設定する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>void - <function>xslt_output_endtransform</function> - </funcdef> - <void/> + <funcdef>void <function>xslt_set_error_handler</function></funcdef> + <paramdef>resource <parameter>xh</parameter></paramdef> + <paramdef>mixed <parameter>handler</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - <function>xslt_output_endtransform</function> は、 - <function>xslt_output_begintransform</function> 関数で開始した出力の変換を - 終了します。出力の変換の結果を見るためには、この関数をコールする - 必要があります。 + +<parameter>xh</parameter>で指定したXSLTプロセッサ用にエラーハンド + +ラ関数を設定します。この関数は、XSLT変換においてエラーが発生する + +度にコールされます。(この関数は通知のためにもコールされます) </para> </refsect1> </refentry> - <refentry id="function.xslt-process"> + <refentry id="function.xslt-set-base"> <refnamediv> - <refname>xslt_process</refname> - <refpurpose>XSLデータを有する文字列によりXMLデータを変換する</refpurpose> + <refname>xslt_set_base</refname> + <refpurpose>全てのXSLT変換用の基準URIを設定する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>bool - <function>xslt_process</function> - </funcdef> - <paramdef>string <parameter>xsl_data</parameter></paramdef> - <paramdef>string <parameter>xml_data</parameter></paramdef> - <paramdef>string <parameter>result</parameter></paramdef> + <funcdef>void <function>xslt_set_base</function></funcdef> + <paramdef>resource <parameter>xh</parameter></paramdef> + <paramdef>string <parameter>uri</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; - <para> - <function>xslt_process</function> は、XSLT スタイルシートを有する - 文字列を最初の引数、変換したいXMLデータを有する文字列を2番目の引 - 数、変換結果を有する文字列を3番目の引数とします。 - <function>xslt_process</function> は、成功時に &true;、失敗時に - &false; を返します。エラーが発生した場合にエラー番号とエラー文字列 - を得るには、関数 <function>xslt_errno</function> および - <function>xslt_error</function> を使用して下さい。 - </para> <para> - <example> - <title> - 3つの文字列を変換するために <function>xslt_process</function> - を使用する - </title> - <programlisting role="php"> -<?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%"> - &#160; - </td> - <td width="80%"> - <h2><xsl:value-of select="title"/></h2> - <h3><xsl:value-of select="author"/></h3> - <br/> - - <xsl:copy-of select="p"/> - </td> - </tr> - </table> -</xsl:template> - -</xsl:stylesheet>'; - -$xmlData = '<?xml version="1.0"?> -<article> - <title>Learning German</title> - <author>Sterling Hughes</author> - <p> - Essential phrases: - <br/> - K&#246;nnen Sie mir sagen, wo die Toilette ist?<br/> - Ein grosses Bier, bitte!<br/> - Noch eins, bitte.<br/> - </p> -</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; -} -?> - </programlisting> - </example> + +全てのXSLT変換の基準URIを設定します。基準URIは、外部リソースにア + +クセスするdocument()及び他のコマンドを解決する際にXpath命令に関し + て使用されます。 </para> </refsect1> </refentry> - <refentry id="function.xslt-run"> + <refentry id="function.xslt-set-encoding"> <refnamediv> - <refname>xslt_run</refname> - <refpurpose>XSLTスタイルシートをファイルに適用する</refpurpose> + <refname>xslt_set_encoding</refname> + <refpurpose> + XMLドキュメントをパースするエンコーディングを設定する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>bool <function>xslt_run</function></funcdef> - <paramdef>resource <parameter>xh</parameter></paramdef> - <paramdef>string <parameter>xslt_file</parameter></paramdef> - <paramdef>string <parameter>xml_data_file</parameter></paramdef> - <paramdef>string <parameter>result</parameter></paramdef> - <paramdef>array <parameter>xslt_params</parameter></paramdef> - <paramdef>array <parameter>xslt_args</parameter></paramdef> + <funcdef>void <function>xslt_set_encoding</function></funcdef> + <paramdef>resource <parameter>xh</parameter></paramdef> + <paramdef>string <parameter>encoding</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; - <para> - xslt_file スタイルシートを適用することにより xml_data_file を処理 - する。スタイルシートは xslt_params にアクセスし、プロセッサは - xslt_args を指定して開始されます。XSLT変換の結果は、名前のあるバッ - ファ(デフォルトは "/_result")に置かれます。 + <para> + XSLT変換の出力エンコーディングを設定します。 + +Sablotronバックエンドを使用する際、このオプションは、Sablotronに + +エンコーディングサポートを付けてコンパイルした場合のみ利用可能で + す。 </para> </refsect1> </refentry> - <refentry id="function.xslt-set-sax-handler"> + <refentry id='function.xslt-set-sax-handlers'> <refnamediv> - <refname>xslt_set_sax_handler</refname> - <refpurpose>XSLTプロセッサに SAX ハンドラを設定する</refpurpose> + <refname>xslt_set_sax_handlers</refname> + <refpurpose> + +XMLドキュメントを処理する際にコールされるSAXハンドラを設定する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>bool <function>xslt_set_sax_handler</function></funcdef> - <paramdef>resource <parameter>xh</parameter></paramdef> + <funcdef>void <function>xslt_set_sax_handlers</function></funcdef> + <paramdef>resource <parameter>processor</parameter></paramdef> <paramdef>array <parameter>handlers</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - <parameter>xh</parameter>で指定したリソースハンドルにSAX ハンドラ - を設定します。 + &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id="function.xslt-transform"> + <refentry id='function.xslt-set-scheme-handlers'> <refnamediv> - <refname>xslt_transform</refname> - <refpurpose>XSLT 変換を実行する</refpurpose> + <refname>xslt_set_scheme_handlers</refname> + <refpurpose> + XSLTプロセッサに関するスキーマハンドラを設定する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>bool - <function>xslt_transform</function> - </funcdef> - <paramdef>string <parameter>xsl</parameter></paramdef> - <paramdef>string <parameter>xml</parameter></paramdef> - <paramdef>string <parameter>result</parameter></paramdef> - <paramdef>string <parameter>params</parameter></paramdef> - <paramdef>string <parameter>args</parameter></paramdef> - <paramdef>string <parameter>resultBuffer</parameter></paramdef> + <funcdef>void <function>xslt_set_scheme_handlers</function></funcdef> + <paramdef>resource <parameter>processor</parameter></paramdef> + <paramdef>array <parameter>handlers</parameter></paramdef> </funcprototype> </funcsynopsis> - &warn.experimental.func; <para> - <function>xslt_transform</function> は、リソースAPIを使用すること - なく、Sablotron のより高度な機能へのインターフェースを提供します。 + &warn.undocumented.func; </para> </refsect1> </refentry> Index: phpdoc/ja/functions/yaz.xml diff -u phpdoc/ja/functions/yaz.xml:1.10 phpdoc/ja/functions/yaz.xml:1.11 --- phpdoc/ja/functions/yaz.xml:1.10 Wed Dec 12 15:53:53 2001 +++ phpdoc/ja/functions/yaz.xml Sun Jan 27 09:48:14 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.11 $ --> <reference id="ref.yaz"> <title>YAZ 関数</title> <titleabbrev>YAZ</titleabbrev> @@ -38,7 +39,8 @@ </para> <para> <informalexample> - <programlisting> + <programlisting role="shell"> +<![CDATA[ gunzip -c yaz-1.6.tar.gz|tar xf - gunzip -c php-4.0.X.tar.gz|tar xf - cd yaz-1.6 @@ -49,6 +51,7 @@ ./configure --with-yaz=/usr/bin make make install +]]> </programlisting> </informalexample> </para> @@ -76,33 +79,34 @@ 索します。 </simpara> <programlisting role="php"> +<![CDATA[ $num_hosts = count ($host); if (empty($term) || count($host) == 0) { - echo '<form method="get"> - <input type="checkbox" - name="host[]" value="bagel.indexdata.dk/gils"> + echo '<form method="get"> + <input type="checkbox" + name="host[]" value="bagel.indexdata.dk/gils"> GILS test - <input type="checkbox" - name="host[]" value="localhost:9999/Default"> + <input type="checkbox" + name="host[]" value="localhost:9999/Default"> local test - <input type="checkbox" checked="1" - name="host[]" value="z3950.bell-labs.com/books"> + <input type="checkbox" checked="1" + name="host[]" value="z3950.bell-labs.com/books"> BELL Labs Library - <br> + <br> RPN Query: - <input type="text" size="30" name="term"> - <input type="submit" name="action" value="Search"> + <input type="text" size="30" name="term"> + <input type="submit" name="action" value="Search"> '; } else { - echo 'You searced for ' . htmlspecialchars($term) . '<br>'; - for ($i = 0; $i < $num_hosts; $i++) { + echo 'You searced for ' . htmlspecialchars($term) . '<br>'; + for ($i = 0; $i < $num_hosts; $i++) { $id[] = yaz_connect($host[$i]); yaz_syntax($id[$i],"sutrs"); yaz_search($id[$i],"rpn",$term); } yaz_wait(); - for ($i = 0; $i < $num_hosts; $i++) { - echo '<hr>' . $host[$i] . ":"; + for ($i = 0; $i < $num_hosts; $i++) { + echo '<hr>' . $host[$i] . ":"; $error = yaz_error($id[$i]); if (!empty($error)) { echo "Error: $error"; @@ -110,17 +114,18 @@ $hits = yaz_hits($id[$i]); echo "Result Count $hits"; } - echo '<dl>'; - for ($p = 1; $p <= 10; $p++) { + echo '<dl>'; + for ($p = 1; $p <= 10; $p++) { $rec = yaz_record($id[$i],$p,"string"); if (empty($rec)) continue; - echo "<dt><b>$p</b></dt><dd>"; - echo ereg_replace("\n", "<br>\n",$rec); - echo "</dd>"; + echo "<dt><b>$p</b></dt><dd>"; + echo ereg_replace("\n", "<br>\n",$rec); + echo "</dd>"; } - echo '</dl>'; + echo '</dl>'; } } +]]> </programlisting> </example> </para> @@ -202,7 +207,7 @@ </para> <para> <parameter>options</parameter> に配列が指定された場合、その配列の内 - 容はオプションとして処理されます。配列オプションは、PHP 4.0.7以降 + +容はオプションとして処理されます。配列オプションは、PHP +4.1.0以降 でのみサポートされることに注意して下さい。 <variablelist> @@ -353,6 +358,38 @@ </refsect1> </refentry> + <refentry id="function.yaz-database"> + <refnamediv> + <refname>yaz_database</refname> + <refpurpose> + セッション内のデータベースを指定する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>yaz_database</function></funcdef> + <paramdef>int <parameter>id</parameter></paramdef> + <paramdef>string <parameter>databases</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + +この関数は、検索、取得等で使用する1つまたは複数のデータベースを + 指定します。<function>yaz_connect</function>をコールする際に指定 + +したデータベースを上書きします。複数のデータベースは、可算記号 + <literal>+</literal>で区切ります。 + </para> + <para> + +この関数は、あるセッションの中で異なるデータベースの集合を使用す + ることを可能にします。 + </para> + <para> + 成功時に&true;、エラー時に&false;を返します。 + </para> + </refsect1> + </refentry> + <refentry id="function.yaz-range"> <refnamediv> <refname>yaz_range</refname> @@ -542,7 +579,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>yaz_present</function></funcdef> - <void></void> + <void/> </funcprototype> </funcsynopsis> <para> @@ -626,34 +663,36 @@ <example> <title>タイトルをスキャンするPHP関数</title> <programlisting> +<![CDATA[ function scan_titles($id, $starterm) { yaz_scan($id,"rpn", "@attr 1=4 " . $starterm); yaz_wait(); $errno = yaz_errno($id); if ($errno == 0) { - $ar = yaz_scan_result($id,&$options); + $ar = yaz_scan_result($id,&$options); echo 'Scan ok; '; - $ar = yaz_scan_result($id, &$options); + $ar = yaz_scan_result($id, &$options); while(list($key,$val)=each($options)) { echo "$key = $val "; } - echo '<br><table><tr><td>'; + echo '<br><table><tr><td>'; while(list($key,list($k, $term, $tcount))=each($ar)) { if (empty($k)) continue; - echo "<tr><td>$term</td><td>"; + echo "<tr><td>$term</td><td>"; echo $tcount; - echo "</td></tr>"; + echo "</td></tr>"; } - echo '</table>'; + echo '</table>'; } else { - echo "Scan failed. Error: " . yaz_error($id) . "<br>"; + echo "Scan failed. Error: " . yaz_error($id) . "<br>"; } } - </programlisting> - </example> - </para> - </refsect1> - </refentry> +]]> + </programlisting> + </example> + </para> + </refsect1> + </refentry> <refentry id="function.yaz-scan-result"> <refnamediv> @@ -721,10 +760,12 @@ ゲットIDであることを仮定しています。 </simpara> <programlisting> - $field["ti"] = "1=4"; - $field["au"] = "1=1"; - $field["isbn"] = "1=7"; - yaz_ccl_conf($id,$field); +<![CDATA[ + $field["ti"] = "1=4"; + $field["au"] = "1=1"; + $field["isbn"] = "1=7"; + yaz_ccl_conf($id,$field); +]]> </programlisting> </example> </para> @@ -935,6 +976,75 @@ </refsect1> </refentry> + <refentry id="function.yaz-sort"> + <refnamediv> + <refname>yaz_sort</refname> + <refpurpose>ソートの基準を設定する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>yaz_sort</function></funcdef> + <paramdef>int <parameter>id</parameter></paramdef> + <paramdef>string <parameter>criteria</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + この関数は、ソートの基準を設定し、Z39.50 +Sortを有効にします。 + この関数は、<function>yaz_search</function>または + <function>yaz_present</function>と共に使用して下さい。この関数の + みを使用しても何も意味はありません。 + <function>yaz_search</function>と組み合わせて使用した場合、 + 検索応答が受信され、全てのZ39.50 +Presentで取得される前にZ39.50 + Sortが送信されます。 + </para> + <para> + <replaceable>field1 flags1 field2 flags2</replaceable> ... + </para> + <para> + +ただし、field1は最初の属性でのソートを指定し、2番目にfield2といっ + たように指定します。フィールドは、カンマで区切られた +型=値 の組か + らなる数値属性の組み合わせ(例 +<literal>1=4,2=1</literal>)、または、 + 文字列の方法を指定することも可能です。 + (例 <literal>title</literal>) + +フラグは、次の文字の並びからなり、空白により区切ることはありません。 + </para> + <variablelist> + <title>ソートフラグ</title> + <varlistentry><term><literal>a</literal></term><listitem> + <simpara>昇順ソート</simpara></listitem> + </varlistentry> + <varlistentry><term><literal>d</literal></term><listitem> + <simpara>降順ソート</simpara></listitem> + </varlistentry> + <varlistentry><term><literal>i</literal></term><listitem> + <simpara>大文字小文字を区別しないソート</simpara></listitem> + </varlistentry> + <varlistentry><term><literal>s</literal></term><listitem> + <simpara>文字小文字を区別するソート</simpara></listitem> + </varlistentry> + </variablelist> + <example> + <title>ソート方法</title> + <para> + +Bib1属性タイトルで大文字小文字を区別しない昇順のソートを行うには、 + 以下のソート方法を使用して下さい。 + <screen> + 1=4 ia + </screen> + </para> + <para> + +2番目のソート方法をauthorとし、大文字小文字を区別する昇順のソー + トを行うには、以下のようにします。 + <screen> + 1=4 ia 1=1003 sa + </screen> + </para> + </example> + </refsect1> + </refentry> + </reference> <!-- Keep this comment at the end of the file Index: phpdoc/ja/functions/zip.xml diff -u phpdoc/ja/functions/zip.xml:1.4 phpdoc/ja/functions/zip.xml:1.5 --- phpdoc/ja/functions/zip.xml:1.4 Wed Dec 12 15:53:53 2001 +++ phpdoc/ja/functions/zip.xml Sun Jan 27 09:48:14 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.5 $ --> <reference id="ref.zip"> <title>Zipファイル関数(読込のみ)</title> <titleabbrev>Zip</titleabbrev> @@ -21,6 +22,12 @@ コンパイルする必要があります。このモジュールは、ZZIPlib バージョン >= 0.10.6を必要とします。 </para> + <note> + <para> + Zipサポートは、PHP +4.1.0以前は実験的なものでした。この拡張モジュー + ルは、PHP +4.1.0以降に存在するZIP拡張モジュールを反映しています。 + </para> + </note> <sect1 id="zip-example"> <title>使用例</title> @@ -33,7 +40,8 @@ <example> <title>Zip の使用例</title> <programlisting role="php"> -<?php +<![CDATA[ +<?php $zip = zip_open("/tmp/test2.zip"); @@ -60,7 +68,8 @@ } -?> +?> +]]> </programlisting> </example> </sect1> @@ -80,16 +89,16 @@ </funcprototype> </funcsynopsis> <para> - Closes a zip file archive. The parameter - <parameter>zip</parameter> must be a zip archive previously - opened by <function>zip_open</function>. + zipファイルアーカイブを閉じます。パラメータ + <parameter>zip</parameter>は、<function>zip_open</function>により + 以前オープンされたzipアーカイブとする必要があります。 </para> <para> - This function has no return value. + この関数には返り値がありません。 </para> <para> - See also <function>zip_open</function> and - <function>zip_read</function>. + <function>zip_open</function>および + <function>zip_read</function>も参照下さい。 </para> </refsect1> </refentry> @@ -239,7 +248,9 @@ <funcdef>bool <function>zip_entry_open</function></funcdef> <paramdef>resource <parameter>zip</parameter></paramdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> - <paramdef>string <parameter><optional>mode</optional></parameter></paramdef> + <paramdef>string + <parameter><optional>mode</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -289,7 +300,9 @@ <funcprototype> <funcdef>string <function>zip_entry_read</function></funcdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> - <paramdef>int <parameter><optional>length</optional></parameter></paramdef> + <paramdef>int + <parameter><optional>length</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para>