cvs: phpdoc-zh /reference/xml/functions xml-parse-into-struct.xml xml-set-processing-instruction-handler.xml xml-set-unparsed-entity-decl-handler.xml

From: Date: Wed, 07 Aug 2002 01:53:57 +0000
Subject: cvs: phpdoc-zh /reference/xml/functions xml-parse-into-struct.xml xml-set-processing-instruction-handler.xml xml-set-unparsed-entity-decl-handler.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-277@lists.php.net to get a copy of this message
gregory Tue Aug 6 21:53:57 2002 EDT Modified files: /phpdoc-zh/reference/xml/functions xml-parse-into-struct.xml xml-set-processing-instruction-handler.xml xml-set-unparsed-entity-decl-handler.xml Log: Mistakes are corrected...

Index: phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml diff -u phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml:1.2 phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml:1.3 --- phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml:1.2 Tue Aug 6 05:18:24 2002 +++ phpdoc-zh/reference/xml/functions/xml-parse-into-struct.xml Tue Aug 6 21:53:57 2002 @@ -1,15 +1,15 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: gregory $ --> <!-- EN-Revision: 1.3 Maintainer: Gregory Status: ready --> <!-- splitted from ./en/functions/xml.xml, last change in rev 1.11 --> <refentry id="function.xml-parse-into-struct"> <refnamediv> <refname>xml_parse_into_struct</refname> - <refpurpose>Parse XML data into an array structure</refpurpose> + <refpurpose>½« XML Êý¾Ý½âÎöµ½Êý×éÖÐ</refpurpose> </refnamediv> <refsect1> - <title>Description</title> + <title>ÃèÊö</title> <methodsynopsis> <type>int</type><methodname>xml_parse_into_struct</methodname> <methodparam><type>resource</type><parameter>parser</parameter></methodparam> @@ -18,18 +18,10 @@ <methodparam><type>array</type><parameter>&amp;index</parameter></methodparam> </methodsynopsis> <para> - This function parses an XML file into 2 parallel array - structures, one (<parameter>index</parameter>) containing pointers - to the location of the appropriate values in the - <parameter>values</parameter> array. These last two parameters - must be passed by reference. + ¸Ãº¯Êý½« XML Îļþ½âÎöµ½Á½¸ö¶ÔÓ¦µÄÊý×éÖУ¬<parameter>index</parameter> ²ÎÊýº¬ÓÐÖ¸Ïò <parameter>values</parameter> Êý×éÖжÔÓ¦ÖµµÄÖ¸Õë¡£×îºóÁ½¸öÊý×é²ÎÊý¿ÉÓÉÖ¸Õë´«µÝ¸øº¯Êý¡£ </para> <para> - Below is an example that illustrates the internal structure of - the arrays being generated by the function. We use a simple - <literal>note</literal> tag embeded inside a - <literal>para</literal> tag, and then we parse this an print out - the structures generated: + ÒÔÏ·¶ÀýÏÔʾÁËÓɸú¯ÊýÉú³ÉµÄÊý×éµÄÄÚ²¿½á¹¹¡£ÎÒÃǼòµ¥µØ½«Ò»¸ö <literal>note</literal> ǶÈëµ½Ò»¸ö <literal>para</literal> ±ê¼ÇÖУ¬½âÎöºóÎÒÃÇ¿ÉÒÔ´òÓ¡³öÉú³ÉµÄÊý×éµÄ½á¹¹£º <informalexample> <programlisting role="php"> <![CDATA[ @@ -44,7 +36,7 @@ ]]> </programlisting> </informalexample> - When we run that code, the output will be: + ÔËÐÐÒÔÉÏ´úÂ룬ÎÒÃǵõ½µÄÊä³ö½«ÊÇ£º <informalexample> <screen> <![CDATA[ @@ -95,15 +87,9 @@ </informalexample> </para> <para> - Event-driven parsing (based on the expat library) can get - complicated when you have an XML document that is complex. - This function does not produce a DOM style object, but it - generates structures amenable of being transversed in a tree - fashion. Thus, we can create objects representing the data - in the XML file easily. Let's consider the following XML file - representing a small database of aminoacids information: + Èç¹ûÄúµÄ XML ÎĵµºÜ¸´ÔÓ£¬»ùÓÚ¸ÃÎĵµµÄʼþ´¦Àí£¨Event-driven£©½âÎö£¨»ùÓÚ expat À©Õ¹¿â£©Ò²»á¶ÔÓ¦µÄ±äµÃ¸´ÔÓ¡£¸Ãº¯ÊýÉú³ÉµÄ²¢·Ç DOM ·ç¸ñµÄ¶ÔÏ󣬶øÊǺáÏòµÄÊ÷×´½á¹¹¡£Òò´Ë£¬ÎÒÃÇÄܹ»·½±ãµÄ½¨Á¢±í´ï XML ÎļþÊý¾ÝµÄ¶ÔÏó¡£ÎÒÃǼÙÉèÒÔÏ XML Îļþ±íʾһ¸ö¹ØÓÚ°±»ùËáÐÅÏ¢µÄСÐÍÊý¾Ý¿â£º <example> - <title>moldb.xml - small database of molecular information</title> + <title>moldb.xml - ·Ö×ÓÐÅÏ¢µÄСÐÍÊý¾Ý¿â</title> <programlisting role="xml"> <![CDATA[ <?xml version="1.0"?> @@ -127,12 +113,10 @@ ]]> </programlisting> </example> - And some code to parse the document and generate the appropriate - objects: + ÒÔÏÂÊǽâÎö¸ÃÎĵµ²¢Éú³ÉÏàÓ¦¶ÔÏóµÄ´úÂ룺 <example> <title> - parsemoldb.php - parses moldb.xml into and array of - molecular objects + parsemoldb.php - ½« moldb.xml ½âÎöµ½·Ö×Ó£¨molecular£©¶ÔÏóµÄÊý×éÖÐ </title> <programlisting role="php"> <![CDATA[ @@ -191,10 +175,7 @@ ]]> </programlisting> </example> - After executing <filename>parsemoldb.php</filename>, the variable - <varname>$db</varname> contains an array of - <classname>AminoAcid</classname> objects, and the output of the - script confirms that: + ÔÚÖ´ÐÐÍê <filename>parsemoldb.php</filename> ºó£¬±äÁ¿ <varname>$db</varname> ½«°üº¬ÓÐÒ»¸öÓÉ <classname>AminoAcid</classname> ¶ÔÏó×é³ÉµÄÊý×飬¸Ã½Å±¾µÄÊä³öÈçÏ£º <informalexample> <screen> <![CDATA[ Index: phpdoc-zh/reference/xml/functions/xml-set-processing-instruction-handler.xml diff -u phpdoc-zh/reference/xml/functions/xml-set-processing-instruction-handler.xml:1.2 phpdoc-zh/reference/xml/functions/xml-set-processing-instruction-handler.xml:1.3 --- phpdoc-zh/reference/xml/functions/xml-set-processing-instruction-handler.xml:1.2 Tue Aug 6 05:18:24 2002 +++ phpdoc-zh/reference/xml/functions/xml-set-processing-instruction-handler.xml Tue Aug 6 21:53:57 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: gregory $ --> <!-- EN-Revision: 1.3 Maintainer: Gregory Status: ready --> <!-- splitted from ./en/functions/xml.xml, last change in rev 1.2 --> @@ -7,7 +7,7 @@ <refnamediv> <refname>xml_set_processing_instruction_handler</refname> <refpurpose> - ½¨Á¢¹ý³ÌÖ¸ÁPI£©´¦ÀíÆ÷ + ½¨Á¢´¦ÀíÖ¸ÁPI£©´¦ÀíÆ÷ </refpurpose> </refnamediv> <refsect1> @@ -18,10 +18,10 @@ <methodparam><type>string</type><parameter>handler</parameter></methodparam> </methodsynopsis> <para> - Ϊ <parameter>parser</parameter> ²ÎÊýÖ¸¶¨µÄ XML ½âÎöÆ÷½¨Á¢¹ý³ÌÖ¸ÁPI£©´¦ÀíÆ÷º¯Êý¡£²ÎÊý <parameter>start_element_handler</parameter> ºÍ <parameter>end_element_handler</parameter> Ϊ±íʾº¯ÊýÃû³ÆµÄ×Ö·û´®£¬ÕâЩº¯Êý±ØÐëÔÚΪ <parameter>parser</parameter> Ö¸¶¨µÄ½âÎöÆ÷µ÷Óà <function>xml_parse</function> º¯ÊýʱÒÑ´æÔÚ¡£ + Ϊ <parameter>parser</parameter> ²ÎÊýÖ¸¶¨µÄ XML ½âÎöÆ÷½¨Á¢´¦ÀíÖ¸ÁPI£©´¦ÀíÆ÷º¯Êý¡£²ÎÊý <parameter>start_element_handler</parameter> ºÍ <parameter>end_element_handler</parameter> Ϊ±íʾº¯ÊýÃû³ÆµÄ×Ö·û´®£¬ÕâЩº¯Êý±ØÐëÔÚΪ <parameter>parser</parameter> Ö¸¶¨µÄ½âÎöÆ÷µ÷Óà <function>xml_parse</function> º¯ÊýʱÒÑ´æÔÚ¡£ </para> <para> - ¹ý³ÌÖ¸ÁîÓÐÈçϸñʽ£º + ´¦ÀíÖ¸ÁîÓÐÈçϸñʽ£º <informalexample> <programlisting>&lt;? <replaceable>target</replaceable> @@ -30,7 +30,7 @@ </informalexample> </para> <para> - Äú¿ÉÒÔ½« PHP ´úÂë·ÅÖÃÔÚÀàËÆµÄ±êʶ·ûÖУ¬µ«Òª×¢ÒâÒ»¸öÏÞÖÆ£ºÔÚ XML ¹ý³ÌÖ¸ÁPI£©ÖУ¬PI µÄÖÕÖ¹·û£¨<literal>?&gt;</literal>£©²»Äܱ»ÒýºÅÒýÓã¬Òò´Ë¸Ã×Ö·ûÐòÁв»Ó¦¸ÃÔÚÄúÓà PI ǶÈëµ½ XML ÎĵµÖÐµÄ PHP ´úÂëÖгöÏÖ¡£·ñÔò£¬Ê£Ï嵀 PHP ´úÂ룬°üÀ¨¡°ÕæÕý¡±µÄ PI ÖÕÖ¹·û½«±»µ±×÷×Ö·ûÊý¾Ý´¦Àí¡£ + Äú¿ÉÒÔ½« PHP ´úÂë·ÅÖÃÔÚÀàËÆµÄ±êʶ·ûÖУ¬µ«Òª×¢ÒâÒ»¸öÏÞÖÆ£ºÔÚ XML ´¦ÀíÖ¸ÁPI£©ÖУ¬PI µÄÖÕÖ¹·û£¨<literal>?&gt;</literal>£©²»Äܱ»ÒýºÅÒýÓã¬Òò´Ë¸Ã×Ö·ûÐòÁв»Ó¦¸ÃÔÚÄúÓà PI ǶÈëµ½ XML ÎĵµÖÐµÄ PHP ´úÂëÖгöÏÖ¡£·ñÔò£¬Ê£Ï嵀 PHP ´úÂ룬°üÀ¨¡°ÕæÕý¡±µÄ PI ÖÕÖ¹·û½«±»µ±×÷×Ö·ûÊý¾Ý´¦Àí¡£ </para> <para> ÓÉ <parameter>handler</parameter> ²ÎÊýÃüÃûµÄº¯ÊýÃû±ØÐë½ÓÊÜÈý¸ö²ÎÊý£º Index: phpdoc-zh/reference/xml/functions/xml-set-unparsed-entity-decl-handler.xml diff -u phpdoc-zh/reference/xml/functions/xml-set-unparsed-entity-decl-handler.xml:1.2 phpdoc-zh/reference/xml/functions/xml-set-unparsed-entity-decl-handler.xml:1.3 --- phpdoc-zh/reference/xml/functions/xml-set-unparsed-entity-decl-handler.xml:1.2 Tue Aug 6 05:18:24 2002 +++ phpdoc-zh/reference/xml/functions/xml-set-unparsed-entity-decl-handler.xml Tue Aug 6 21:53:57 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: gregory $ --> <!-- EN-Revision: 1.3 Maintainer: Gregory Status: ready --> <!-- splitted from ./en/functions/xml.xml, last change in rev 1.2 --> @@ -8,7 +8,6 @@ <refname>xml_set_unparsed_entity_decl_handler</refname> <refpurpose> ½¨Á¢Î´½âÎöʵÌ嶨ÒåÉùÃ÷´¦ÀíÆ÷ - Set up unparsed entity declaration handler </refpurpose> </refnamediv> <refsect1>
« previous php.doc.zh (#277) next »