cvs: phpdoc-zh /reference/xml reference.xml
| From: | Xiaoyu Huang | Date: | Thu, 28 Apr 2005 01:31:28 +0000 |
| Subject: | cvs: phpdoc-zh /reference/xml reference.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1957@lists.php.net to get a copy of this message | ||
class007 Wed Apr 27 21:31:28 2005 EDT
Modified files:
/phpdoc-zh/reference/xml reference.xml
Log:
ÓëÓ¢Îİæ 1.17 ͬ²½£¬ÐÞÕý±àÂëÎÊÌâ
http://cvs.php.net/diff.php/phpdoc-zh/reference/xml/reference.xml?r1=1.11&r2=1.12&ty=u
Index: phpdoc-zh/reference/xml/reference.xml
diff -u phpdoc-zh/reference/xml/reference.xml:1.11 phpdoc-zh/reference/xml/reference.xml:1.12
--- phpdoc-zh/reference/xml/reference.xml:1.11 Tue Oct 14 05:34:12 2003
+++ phpdoc-zh/reference/xml/reference.xml Wed Apr 27 21:31:28 2005
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.11 $ -->
-<!-- $Author: gregory $ -->
-<!-- EN-Revision: 1.12 Maintainer: Gregory Status: ready -->
+<?xml version="1.0" encoding="gb2312"?>
+<!-- $Revision: 1.12 $ -->
+<!-- $Author: class007 $ -->
+<!-- EN-Revision: 1.17 Maintainer: Gregory Status: ready -->
<reference id="ref.xml">
<title>XML Óï·¨½âÎöº¯Êý¿â</title>
<titleabbrev>XML</titleabbrev>
@@ -25,7 +25,7 @@
<section id="xml.requirements">
&reftitle.required;
<para>
- ¸ÃÀ©Õ¹Ä£¿éÐèҪʹÓÃ
<productname>expat</productname>£¬Äú¿ÉÒÔ·ÃÎÊ <ulink
url="&url.expat;">&url.expat;</ulink> À´»ñÈ¡¡£expat ×Ô´øµÄ
Makefile
Îļþ²»»áÉú³ÉĬÈϵÄÀ©Õ¹¿â£¬Äú¿ÉÒÔʹÓÃÒÔϵÄÉú³É¹æÔòÀ´ÊµÏÖ£º
+ ¸ÃÀ©Õ¹Ä£¿éĬÈÏʹÓà <productname>expat compat
layer</productname>¡£ËüÒ²¿ÉÒÔʹÓÃ
<productname>expat</productname>£¬Äú¿ÉÒÔ·ÃÎÊ <ulink
url="&url.expat;">&url.expat;</ulink> À´»ñÈ¡¡£expat ×Ô´øµÄ
Makefile
Îļþ²»»áÉú³ÉĬÈϵÄÀ©Õ¹¿â£¬Äú¿ÉÒÔʹÓÃÒÔϵÄÉú³É¹æÔòÀ´ÊµÏÖ£º
<programlisting role="makefile">
<![CDATA[
libexpat.a: $(OBJS)
@@ -208,16 +208,18 @@
$file = "data.xml";
$depth = array();
-function startElement($parser, $name, $attrs) {
+function startElement($parser, $name, $attrs)
+{
global $depth;
for ($i = 0; $i < $depth[$parser]; $i++) {
- print " ";
+ echo " ";
}
- print "$name\n";
+ echo "$name\n";
$depth[$parser]++;
}
-function endElement($parser, $name) {
+function endElement($parser, $name)
+{
global $depth;
$depth[$parser]--;
}
@@ -262,22 +264,25 @@
"LITERAL" => "TT"
);
-function startElement($parser, $name, $attrs) {
+function startElement($parser, $name, $attrs)
+{
global $map_array;
- if ($htmltag == $map_array[$name]) {
- print "<$htmltag>";
+ if (isset($map_array[$name])) {
+ echo "<$map_array[$name]>";
}
}
-function endElement($parser, $name) {
+function endElement($parser, $name)
+{
global $map_array;
- if ($htmltag == $map_array[$name]) {
- print "</$htmltag>";
+ if (isset($map_array[$name])) {
+ echo "</$map_array[$name]>";
}
}
-function characterData($parser, $data) {
- print $data;
+function characterData($parser, $data)
+{
+ echo $data;
}
$xml_parser = xml_parser_create();
@@ -321,7 +326,8 @@
<?php
$file = "xmltest.xml";
-function trustedFile($file) {
+function trustedFile($file)
+{
// only trust local files owned by ourselves
if (!eregi("^([a-z]+)://", $file)
&& fileowner($file) == getmyuid()) {
@@ -330,26 +336,30 @@
return false;
}
-function startElement($parser, $name, $attribs) {
- print "<<font color=\"#0000cc\">$name</font>";
+function startElement($parser, $name, $attribs)
+{
+ echo "<<font color=\"#0000cc\">$name</font>";
if (sizeof($attribs)) {
while (list($k, $v) = each($attribs)) {
- print " <font color=\"#009900\">$k</font>=\"<font
+ echo " <font color=\"#009900\">$k</font>=\"<font
color=\"#990000\">$v</font>\"";
}
}
- print ">";
+ echo ">";
}
-function endElement($parser, $name) {
- print "</<font color=\"#0000cc\">$name</font>>";
+function endElement($parser, $name)
+{
+ echo "</<font color=\"#0000cc\">$name</font>>";
}
-function characterData($parser, $data) {
- print "<b>$data</b>";
+function characterData($parser, $data)
+{
+ echo "<b>$data</b>";
}
-function PIHandler($parser, $target, $data) {
+function PIHandler($parser, $target, $data)
+{
switch (strtolower($target)) {
case "php":
global $parser_file;
@@ -366,7 +376,8 @@
}
}
-function defaultHandler($parser, $data) {
+function defaultHandler($parser, $data)
+{
if (substr($data, 0, 1) == "&" && substr($data, -1, 1) == ";")
{
printf('<font color="#aa00aa">%s</font>',
htmlspecialchars($data));
@@ -399,7 +410,8 @@
return false;
}
-function new_xml_parser($file) {
+function new_xml_parser($file)
+{
global $parser_file;
$xml_parser = xml_parser_create();
@@ -424,7 +436,7 @@
die("could not open XML input");
}
-print "<pre>";
+echo "<pre>";
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d\n",
@@ -432,8 +444,8 @@
xml_get_current_line_number($xml_parser)));
}
}
-print "</pre>";
-print "parse complete\n";
+echo "</pre>";
+echo "parse complete\n";
xml_parser_free($xml_parser);
?>
@@ -469,7 +481,7 @@
<title>About this Document</title>
<para>
<!-- this is a comment -->
- <?php print 'Hi! This is PHP version '.phpversion(); ?>
+ <?php echo 'Hi! This is PHP version ' . phpversion(); ?>
</para>
</section>
</chapter>
@@ -490,7 +502,7 @@
<foo>
<element attrib="value"/>
&testEnt;
- <?php print "This is some more PHP code being executed."; ?>
+ <?php echo "This is some more PHP code being executed."; ?>
</foo>
]]>
</programlisting>