fujimoto Sat Jan 5 10:16:28 2002 EDT
Modified files:
/phpdoc/ja/language types.xml
Log:
Eliminate tags in CDATA sections (as en did).
Index: phpdoc/ja/language/types.xml
diff -u phpdoc/ja/language/types.xml:1.16 phpdoc/ja/language/types.xml:1.17
--- phpdoc/ja/language/types.xml:1.16 Fri Dec 14 11:22:11 2001
+++ phpdoc/ja/language/types.xml Sat Jan 5 10:16:28 2002
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 1.17 $ -->
<chapter id="language.types">
<title>型</title>
@@ -163,10 +164,10 @@
<link linkend="control-structures">制御構造</link>にその結果を渡
します。
<informalexample>
- <!-- intentionally omitting CDATA -->
<programlisting role="php">
-if ($action == "show_version") // == は、<type>boolean</type>型を返す
- // <link linkend="language.operators">演算子</link>
+<![CDATA[
+// == は、boolean型を返す演算子
+if ($action == "show_version")
{
echo "バージョンは1.23です。";
}
@@ -174,14 +175,15 @@
// これは冗長
if ($show_separators == true)
{
- echo "<hr>\n";
+ echo "<hr>\n";
}
// 上の例は次のように簡単に書くことができます。
if ($show_separators)
{
- echo "<hr>\n";
+ echo "<hr>\n";
}
+]]>
</programlisting>
</informalexample>
</para>
@@ -808,22 +810,25 @@
</simpara>
<informalexample>
- <!-- intentionally omitting CDATA -->
<programlisting role="php">
-$fruits = array( 'strawberry' => 'red' , 'banana' => 'yellow' );
-echo "A banana is $fruits[banana]."; //
シングルクオートの外では動作が異なることに注意してください。
- // <link
linkend="language.types.array.foo-bar"><literal>$foo[bar]</literal></link>を参照してください。
-echo "This square is $square->width meters broad.";
-echo "This square is $square->width00 centimeters broad."; // 動作しません。
- // 解決策については、<link
linkend="language.types.string.parsing.complex">複雑な構文</link>を参照下さい。
+<![CDATA[
+$fruits = array( 'strawberry' => 'red' , 'banana' => 'yellow' );
+
+//
+シングルクオートの外では動作が異なることに注意してください。
+echo "A banana is $fruits[banana].";
+
+echo "This square is $square->width meters broad.";
+//
+動作しません。解決策については、複雑な構文を参照下さい。
+echo "This square is $square->width00 centimeters broad.";
+
+]]>
<!-- XXX this won't work:
echo "This square is $square->{width}00 centimeters broad.";
// XXX: php developers: it would be consequent to make this work.
// XXX: like the $obj->{expr} syntax outside a string works,
// XXX: analogously to the ${expr} syntax for variable var's.
-->
-
</programlisting>
</informalexample>
<simpara>
@@ -845,24 +850,28 @@
以下のいくつかの例を見ると理解しやすくなるでしょう。
</simpara>
<informalexample>
- <!-- intentionally omitting CDATA -->
<programlisting role="php">
+<![CDATA[
$great = 'fantastic';
echo "This is { $great}"; // 動作しません。出力は、This is { fantastic}
echo "This is {$great}"; // 動作します。出力は、This is fantastic
-echo "This square is {$square->width}00 centimeters broad.";
+echo "This square is {$square->width}00 centimeters broad.";
echo "This works: {$arr[4][3]}";
-echo "This is wrong: {$arr[foo][3]}"; // <link
linkend="language.types.array.foo-bar">$foo[bar]</link>
- // が文字列の外では使用できないのと同じ理由で動作せず。
+
+// $foo[bar]が文字列の外では使用できないのと
+// 同じ理由で動作せず。
+echo "This is wrong: {$arr[foo][3]}";
+
echo "You should do it this way: {$arr['foo'][3]}";
-echo "You can even write {$obj->values[3]->name}";
+echo "You can even write {$obj->values[3]->name}";
echo "This is the value of the var named $name: {${$name}}";
-<!-- <xxx> maybe it's better to leave this out??
+]]>
+<!-- maybe it's better to leave this out??
// this works, but i disencourage its use, since this is NOT
// involving functions, rather than mere variables, arrays and objects.
$beer = 'Heineken';
echo "I'd like to have another {${ strrev('reeb') }}, hips";
- </xxx> -->
+ -->
</programlisting>
</informalexample>
</sect4>
@@ -884,10 +893,10 @@
<example>
<title>複数のstringの例</title>
<programlisting role="php">
-<![CDATA[
<!-- TODO: either move these examples to a example section,
as with arrays, or distribute them under the applicable
sections. -->
+<![CDATA[
<?php
/* 文字列に代入。 */
$str = "This is a string";
@@ -1300,8 +1309,8 @@
// マップを行う配列
$map = array( 'version' => 4
, 'OS' => 'Linux'
- , 'lang' => 'english'
- , 'short_tags' => true
+ , 'lang' => 'english'
+ , 'short_tags' => true
);
// 数値キーのみを有する
@@ -1323,6 +1332,9 @@
, 0 => 12 // 値10は12で上書きされます
);
+// empty array
+$empty = array();
+]]>
<!-- TODO example of
- mixed keys
- overwriting keys
@@ -1330,10 +1342,6 @@
- using vars/functions as key/values
- mixed skipping
-->
-
-// empty array
-$empty = array();
-]]>
</programlisting>
</example>
@@ -1370,14 +1378,15 @@
<example id="language.types.array.examples.changeloop">
<title>コレクション</title>
<programlisting role="php">
-<link linkend="control-structures.foreach">foreach</link> ( $colors as $key => $color
) {
+<![CDATA[
+foreach ( $colors as $key => $color ) {
// 動作しない:
- //$color = <link linkend="function.strtoupper">strtoupper</link>($color);
+ //$color = strtoupper($color);
// 動作する:
- $colors[$key] = <link linkend="function.strtoupper">strtoupper</link>($color);
+ $colors[$key] = strtoupper($color);
}
-<link linkend="function.print-r">print_r</link>($colors);
+print_r($colors);
/* 出力:
Array
@@ -1388,6 +1397,7 @@
[3] => YELLOW
)
*/
+]]>
</programlisting>
</example>
</para>
@@ -1396,8 +1406,9 @@
<example>
<title>1から始まる添字</title>
<programlisting role="php">
+<![CDATA[
$firstquarter = array(1 => 'January', 'February', 'March');
-<link linkend="function.print-r">print_r</link>($firstquarter);
+print_r($firstquarter);
/* 出力:
Array
@@ -1406,20 +1417,23 @@
[2] => 'February'
[3] => 'March'
)
-*/
+*/
+]]>
</programlisting>
</example>
</para>
<example>
<title>配列に代入する</title>
<programlisting role="php">
-// <link
linkend="ref.dir">ディレクトリ</link>から全てのアイテムを配列に代入する
-$handle = <link linkend="function.opendir">opendir</link>('.');
-while ($file = <link linkend="function.readdir">readdir</link>($handle))
+<![CDATA[
+// ディレクトリから全てのアイテムを配列に代入する
+$handle = opendir('.');
+while ($file = readdir($handle))
{
$files[] = $file;
}
-<link linkend="function.closedir">closedir</link>($handle);
+closedir($handle);
+]]>
</programlisting>
</example>
<para>
@@ -1430,8 +1444,10 @@
<example>
<title>配列のソート</title>
<programlisting role="php">
-<link linkend="function.sort">sort</link>($files);
-<link linkend="function.print-r">print_r</link>($files);
+<![CDATA[
+sort($files);
+print_r($files);
+]]>
</programlisting>
</example>
<para>
@@ -1441,23 +1457,24 @@
<example>
<title>再帰および多次元配列</title>
<programlisting role="php">
-$fruits = array ( "fruits" => array ( "a" => "orange"
- , "b" => "banana"
- , "c" => "apple"
+<![CDATA[
+$fruits = array ( "fruits" => array ( "a" => "orange"
+ , "b" => "banana"
+ , "c" => "apple"
)
- , "numbers" => array ( 1
+ , "numbers" => array ( 1
, 2
, 3
, 4
, 5
, 6
)
- , "holes" => array ( "first"
- , 5 => "second"
+ , "holes" => array ( "first"
+ , 5 => "second"
, "third"
)
);
-
+]]>
<!-- quite duplicate...
$a = array(
"apple" => array(
@@ -1677,7 +1694,8 @@
<informalexample>
<programlisting role="php">
-<?php
+<![CDATA[
+<?php
class foo
{
function do_foo()
@@ -1689,6 +1707,7 @@
$bar = new foo;
$bar -> do_foo ();
?>
+]]>
</programlisting>
</informalexample>
</para>