cvs: phpdoc-zh /reference/xml/functions xml-parse-into-struct.xml xml-parser-set-option.xml
| From: | Dallas Thunder | Date: | Mon, 15 Aug 2005 21:19:29 +0000 |
| Subject: | cvs: phpdoc-zh /reference/xml/functions xml-parse-into-struct.xml xml-parser-set-option.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2289@lists.php.net to get a copy of this message | ||
dallas Mon Aug 15 17:19:29 2005 EDT
Modified files:
/phpdoc-zh/reference/xml/functions xml-parse-into-struct.xml
xml-parser-set-option.xml
Log:
Updated.
http://cvs.php.net/diff.php/phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml?r1=1.7&r2=1.8&ty=u
Index: phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml
diff -u phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml:1.7
phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml:1.8
--- phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml:1.7 Thu Apr 28 06:46:22 2005
+++ phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml Mon Aug 15 17:19:28 2005
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="gb2312"?>
-<!-- $Revision: 1.7 $ -->
-<!-- $Author: class007 $ -->
-<!-- EN-Revision: 1.11 Maintainer: class007 Status: ready -->
-<!-- splitted from ./en/functions/xml.xml, last change in rev 1.11 -->
+<!-- $Revision: 1.8 $ -->
+<!-- $Author: dallas $ -->
+<!-- EN-Revision: 1.13 Maintainer: class007 Status: ready -->
<refentry id="function.xml-parse-into-struct">
<refnamediv>
<refname>xml_parse_into_struct</refname>
<refpurpose>½« XML Êý¾Ý½âÎöµ½Êý×éÖÐ</refpurpose>
</refnamediv>
<refsect1>
- <title>ÃèÊö</title>
+ <title>˵Ã÷</title>
<methodsynopsis>
<type>int</type><methodname>xml_parse_into_struct</methodname>
<methodparam><type>resource</type><parameter>parser</parameter></methodparam>
@@ -18,10 +17,21 @@
<methodparam choice="opt"><type>array</type><parameter
role="reference">index</parameter></methodparam>
</methodsynopsis>
<para>
- ¸Ãº¯Êý½« XML
Îļþ½âÎöµ½Á½¸ö¶ÔÓ¦µÄÊý×éÖУ¬<parameter>index</parameter>
²ÎÊýº¬ÓÐÖ¸Ïò <parameter>values</parameter>
Êý×éÖжÔÓ¦ÖµµÄÖ¸Õë¡£×îºóÁ½¸öÊý×é²ÎÊý¿ÉÓÉÖ¸Õë´«µÝ¸øº¯Êý¡£
+ ¸Ãº¯Êý½« XML
Îļþ½âÎöµ½Á½¸ö¶ÔÓ¦µÄÊý×éÖУ¬<parameter>index</parameter>
+ ²ÎÊýº¬ÓÐÖ¸Ïò <parameter>values</parameter>
+
Êý×éÖжÔÓ¦ÖµµÄÖ¸Õë¡£×îºóÁ½¸öÊý×é²ÎÊý¿ÉÓÉÖ¸Õë´«µÝ¸øº¯Êý¡£
</para>
+ <note>
+ <para>
+ <function>xml_parse_into_struct</function> ʧ°Ü·µ»Ø 0£¬³É¹¦·µ»Ø
+ 1¡£ÕâºÍ &false; Óë
+ &true; ²»Í¬£¬Ê¹ÓÃÀýÈç === µÄÔËËã·ûʱҪעÒâ¡£
+ </para>
+ </note>
<para>
-
ÒÔÏ·¶ÀýÏÔʾÁËÓɸú¯ÊýÉú³ÉµÄÊý×éµÄÄÚ²¿½á¹¹¡£ÎÒÃǼòµ¥µØ½«Ò»¸ö
<literal>note</literal> ǶÈëµ½Ò»¸ö <literal>para</literal>
±ê¼ÇÖУ¬½âÎöºóÎÒÃÇ¿ÉÒÔ´òÓ¡³öÉú³ÉµÄÊý×éµÄ½á¹¹£º
+
ÒÔÏ·¶ÀýÏÔʾÁËÓɸú¯ÊýÉú³ÉµÄÊý×éµÄÄÚ²¿½á¹¹¡£ÎÒÃǼòµ¥µØ½«Ò»¸ö
+ <literal>note</literal> ǶÈëµ½Ò»¸ö <literal>para</literal>
+ ±ê¼ÇÖУ¬½âÎöºóÎÒÃÇ¿ÉÒÔ´òÓ¡³öÉú³ÉµÄÊý×éµÄ½á¹¹£º
<example>
<title><function>xml_parse_into_struct</function> ʾÀý</title>
<programlisting role="php">
@@ -130,15 +140,15 @@
var $symbol; // Èý×Öĸ·ûºÅ
var $code; // µ¥×Öĸ´úÂë
var $type; // hydrophobic, charged »ò neutral
-
- function AminoAcid ($aa)
+
+ function AminoAcid ($aa)
{
foreach ($aa as $k=>$v)
$this->$k = $aa[$k];
}
}
-function readDatabase($filename)
+function readDatabase($filename)
{
// ¶ÁÈ¡ aminoacids µÄ XML Êý¾Ý
$data = implode("",file($filename));
@@ -152,10 +162,10 @@
foreach ($tags as $key=>$val) {
if ($key == "molecule") {
$molranges = $val;
- // each contiguous pair of array entries are the
+ // 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;
+ $offset = $molranges[$i] + 1;
$len = $molranges[$i + 1] - $offset;
$tdb[] = parseMol(array_slice($values, $offset, $len));
}
@@ -166,7 +176,7 @@
return $tdb;
}
-function parseMol($mvalues)
+function parseMol($mvalues)
{
for ($i=0; $i < count($mvalues); $i++) {
$mol[$mvalues[$i]["tag"]] = $mvalues[$i]["value"];
http://cvs.php.net/diff.php/phpdoc-zh/reference/xml/functions/xml-parser-set-option.xml?r1=1.3&r2=1.4&ty=u
Index: phpdoc-zh/reference/xml/functions/xml-parser-set-option.xml
diff -u phpdoc-zh/reference/xml/functions/xml-parser-set-option.xml:1.3
phpdoc-zh/reference/xml/functions/xml-parser-set-option.xml:1.4
--- phpdoc-zh/reference/xml/functions/xml-parser-set-option.xml:1.3 Thu Apr 28 06:46:22 2005
+++ phpdoc-zh/reference/xml/functions/xml-parser-set-option.xml Mon Aug 15 17:19:28 2005
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="gb2312"?>
-<!-- $Revision: 1.3 $ -->
-<!-- $Author: class007 $ -->
-<!-- EN-Revision: 1.4 Maintainer: class007 Status: ready -->
-<!-- splitted from ./en/functions/xml.xml, last change in rev 1.2 -->
+<!-- $Revision: 1.4 $ -->
+<!-- $Author: dallas $ -->
+<!-- EN-Revision: 1.6 Maintainer: class007 Status: ready -->
<refentry id="function.xml-parser-set-option">
<refnamediv>
<refname>xml_parser_set_option</refname>
<refpurpose>Ϊָ¶¨ XML ½âÎö½øÐÐÑ¡ÏîÉèÖÃ</refpurpose>
</refnamediv>
<refsect1>
- <title>ÃèÊö</title>
+ <title>˵Ã÷</title>
<methodsynopsis>
<type>bool</type><methodname>xml_parser_set_option</methodname>
<methodparam><type>resource</type><parameter>parser</parameter></methodparam>
@@ -68,8 +67,22 @@
</entry>
</row>
<row>
+ <entry>XML_OPTION_SKIP_TAGSTART</entry>
+ <entry>integer</entry>
+ <entry>
+ Ö¸Ã÷ÔÚÒ»¸ö±ê¼ÇÃûǰӦÂÔ¹ý¼¸¸ö×Ö·û¡£
+ </entry>
+ </row>
+ <row>
+ <entry>XML_OPTION_SKIP_WHITE</entry>
+ <entry>integer</entry>
+ <entry>
+ ÊÇ·ñÂÔ¹ýÓɰ׿Õ×Ö·û×é³ÉµÄÖµ¡£
+ </entry>
+ </row>
+ <row>
<entry>XML_OPTION_TARGET_ENCODING</entry>
- <entry>string</entry>
+ <entry>string</entry>
<entry>
ÉèÖøà XML ½âÎöÆ÷ËùʹÓõÄ<link
linkend="xml.encoding">Ä¿±ê±àÂ루target
encoding£©</link>·½Ê½¡£ÆäĬÈÏÖµºÍÓÉ
<function>xml_parser_create</function> º¯ÊýÉèÖõÄÔ´±àÂ루source
encoding£©·½Ê½Ïàͬ¡£Ö§³ÖµÄÄ¿±ê±àÂ뷽ʽÓÐ
<literal>ISO-8859-1</literal>¡¢<literal>US-ASCII</literal> ºÍ
<literal>UTF-8</literal>¡£
</entry>