PHP XML Parser º¯Êý
PHP XML Parser ¼ò½é
XML º¯ÊýÔÊÐíÎÒÃǽâÎö XML Îĵµ£¬µ«ÎÞ·¨¶ÔÆä½øÐÐÑéÖ¤¡£
XML ÊÇÒ»ÖÖÓÃÓÚ±ê×¼½á¹¹»¯Îĵµ½»»»µÄÊý¾Ý¸ñʽ¡£Äú¿ÉÒÔÔÚÎÒÃÇµÄ XML ½Ì³Ì ÖÐÕÒµ½¸ü¶àÓÐ¹Ø XML µÄÐÅÏ¢¡£
¸ÃÀ©Õ¹Ê¹Óà Expat XML ½âÎöÆ÷¡£
Expat ÊÇÒ»ÖÖ»ùÓÚʼþµÄ½âÎöÆ÷£¬Ëü°Ñ XML ÎĵµÊÓΪһϵÁÐʼþ¡£µ±Ä³¸öʼþ·¢Éúʱ£¬Ëüµ÷ÓÃÒ»¸öÖ¸¶¨µÄº¯Êý´¦ÀíËü¡£
Expat ÊÇÎÞÑéÖ¤µÄ½âÎöÆ÷£¬ºöÂÔÈκÎÁ´½Óµ½ÎĵµµÄ DTD¡£µ«ÊÇ£¬Èç¹ûÎĵµµÄÐÎʽ²»ºÃ£¬Ôò»áÒÔÒ»¸ö´íÎóÏûÏ¢½áÊø¡£
ÓÉÓÚËü»ùÓÚʼþ£¬ÇÒÎÞÑéÖ¤£¬Expat ¾ßÓпìËÙ²¢ÊÊºÏ web Ó¦ÓóÌÐòµÄÌØÐÔ¡£
XML ½âÎöÆ÷º¯ÊýÔÊÐíÎÒÃÇ´´½¨ XML ½âÎöÆ÷£¬²¢Îª XML ʼþ¶¨Òå¾ä±ú¡£
°²×°
XML º¯ÊýÊÇ PHP ºËÐĵÄ×é³É²¿·Ö¡£ÎÞÐè°²×°¼´¿ÉʹÓÃÕâЩº¯Êý¡£
PHP XML Parser º¯Êý
PHP£ºÖ¸Ê¾Ö§³Ö¸Ãº¯ÊýµÄ×îÔçµÄ PHP °æ±¾¡£
º¯Êý | ÃèÊö | PHP |
---|---|---|
utf8_decode() | °Ñ UTF-8 ×Ö·û´®½âÂëΪ ISO-8859-1¡£ | 3 |
utf8_encode() | °Ñ ISO-8859-1 ×Ö·û´®±àÂëΪ UTF-8¡£ | 3 |
xml_error_string() | »ñÈ¡ XML ½âÎöÆ÷µÄ´íÎóÃèÊö¡£ | 3 |
xml_get_current_byte_index() | »ñÈ¡ XML ½âÎöÆ÷µÄµ±Ç°×Ö½ÚË÷Òý¡£ | 3 |
xml_get_current_column_number() | »ñÈ¡ XML ½âÎöÆ÷µÄµ±Ç°Áкš£ | 3 |
xml_get_current_line_number() | »ñÈ¡ XML ½âÎöÆ÷µÄµ±Ç°Ðкš£ | 3 |
xml_get_error_code() | »ñÈ¡ XML ½âÎöÆ÷´íÎó´úÂë¡£ | 3 |
xml_parse() | ½âÎö XML Îĵµ¡£ | 3 |
xml_parse_into_struct() | °Ñ XML Êý¾Ý½âÎöµ½Êý×éÖС£ | 3 |
xml_parser_create_ns() | ´´½¨´øÓÐÃüÃû¿Õ¼äÖ§³ÖµÄ XML ½âÎöÆ÷¡£ | 4 |
xml_parser_create() | ´´½¨ XML ½âÎöÆ÷¡£ | 3 |
xml_parser_free() | ÊÍ·Å XML ½âÎöÆ÷¡£ | 3 |
xml_parser_get_option() | ´Ó XML ½âÎöÆ÷»ñȡѡÏîÉèÖÃÐÅÏ¢¡£ | 3 |
xml_parser_set_option() | Ϊ XML ½âÎö½øÐÐÑ¡ÏîÉèÖᣠ| 3 |
xml_set_character_data_handler() | ½¨Á¢×Ö·ûÊý¾Ý´¦ÀíÆ÷¡£ | 3 |
xml_set_default_handler() | ½¨Á¢Ä¬ÈϵÄÊý¾Ý´¦ÀíÆ÷¡£ | 3 |
xml_set_element_handler() | ½¨Á¢ÆðʼºÍÖÕÖ¹ÔªËØ´¦ÀíÆ÷¡£ | 3 |
xml_set_end_namespace_decl_handler() | ½¨Á¢ÖÕÖ¹ÃüÃû¿Õ¼äÉùÃ÷´¦ÀíÆ÷¡£ | 4 |
xml_set_external_entity_ref_handler() | ½¨Á¢ÍⲿʵÌå´¦ÀíÆ÷¡£ | 3 |
xml_set_notation_decl_handler() | ½¨Á¢×¢ÊÍÉùÃ÷´¦ÀíÆ÷¡£ | 3 |
xml_set_object() | ÔÚ¶ÔÏóÖÐʹÓà XML ½âÎöÆ÷¡£ | 4 |
xml_set_processing_instruction_handler() | ½¨Á¢´¦ÀíÖ¸ÁPI£©´¦ÀíÆ÷¡£ | 3 |
xml_set_start_namespace_decl_handler() | ½¨Á¢ÆðʼÃüÃû¿Õ¼äÉùÃ÷´¦ÀíÆ÷¡£ | 4 |
xml_set_unparsed_entity_decl_handler() | ½¨Á¢Î´½âÎöʵÌ嶨ÒåÉùÃ÷´¦ÀíÆ÷¡£ | 3 |
PHP XML Parser ³£Á¿
Constant |
---|
XML_ERROR_NONE (integer) |
XML_ERROR_NO_MEMORY (integer) |
XML_ERROR_SYNTAX (integer) |
XML_ERROR_NO_ELEMENTS (integer) |
XML_ERROR_INVALID_TOKEN (integer) |
XML_ERROR_UNCLOSED_TOKEN (integer) |
XML_ERROR_PARTIAL_CHAR (integer) |
XML_ERROR_TAG_MISMATCH (integer) |
XML_ERROR_DUPLICATE_ATTRIBUTE (integer) |
XML_ERROR_JUNK_AFTER_DOC_ELEMENT (integer) |
XML_ERROR_PARAM_ENTITY_REF (integer) |
XML_ERROR_UNDEFINED_ENTITY (integer) |
XML_ERROR_RECURSIVE_ENTITY_REF (integer) |
XML_ERROR_ASYNC_ENTITY (integer) |
XML_ERROR_BAD_CHAR_REF (integer) |
XML_ERROR_BINARY_ENTITY_REF (integer) |
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF (integer) |
XML_ERROR_MISPLACED_XML_PI (integer) |
XML_ERROR_UNKNOWN_ENCODING (integer) |
XML_ERROR_INCORRECT_ENCODING (integer) |
XML_ERROR_UNCLOSED_CDATA_SECTION (integer) |
XML_ERROR_EXTERNAL_ENTITY_HANDLING (integer) |
XML_OPTION_CASE_FOLDING (integer) |
XML_OPTION_TARGET_ENCODING (integer) |
XML_OPTION_SKIP_TAGSTART (integer) |
XML_OPTION_SKIP_WHITE (integer) |