If you're wanting to actually work with XML data as it was intended, treating it as a tree, try http://us2.php.net/manual/en/book.simplexml.php .
XML Parser
- Introdução
- Instalação/Configuração
- Constantes pré-definidas
- Manipuladores (handlers) de Evento
- Case Folding
- Códigos de Erro
- Character Encoding
- Exemplos
- Funções para analisar XML
- utf8_decode — Converte uma string com caracteres ISO-8859-1 codificadas com UTF-8 para single-byte ISO-8859-1.
- utf8_encode — Codifica um string ISO-8859-1 para UTF-8
- xml_error_string — Obtém uma string de erro do analisador XML
- xml_get_current_byte_index — Obtém o índice do byte atual para um analisador XML
- xml_get_current_column_number — Obtém o número da coluna atual para um analisador XML
- xml_get_current_line_number — Obtém o número da linha para um analisador XML
- xml_get_error_code — Obtém um código de erro do analisador XML
- xml_parse_into_struct — Analisa dados XML dentro de uma estrutura de array
- xml_parse — Inicia a análise em um documento XML
- xml_parser_create_ns — Cria um analisador XML com suporte a namespace
- xml_parser_create — Cria um analisador XML
- xml_parser_free — Free an XML parser
- xml_parser_get_option — Obtém as opções de um analisador (parser) XML
- xml_parser_set_option — Define opções em um analisador (parser) XML
- xml_set_character_data_handler — Set up character data handler
- xml_set_default_handler — Set up default handler
- xml_set_element_handler — Set up start and end element handlers
- xml_set_end_namespace_decl_handler — Set up end namespace declaration handler
- xml_set_external_entity_ref_handler — Set up external entity reference handler
- xml_set_notation_decl_handler — Set up notation declaration handler
- xml_set_object — Use XML Parser within an object
- xml_set_processing_instruction_handler — Set up processing instruction (PI) handler
- xml_set_start_namespace_decl_handler — Set up start namespace declaration handler
- xml_set_unparsed_entity_decl_handler — Set up unparsed entity declaration handler
pavel dot lishin at gmail dot com ¶
3 years ago
nat ¶
3 years ago
An event-based parser such XML Parser is preferable for large files, because tree-based parsers must fully load the file into memory in order to parse the XML. Event-based parsers do not need to load the entire file into memory to begin parsing.
marcgear at gmail dot com ¶
2 years ago
While this SAX event based parser is better for memory management than the tree based parsers of SimpleXML and DOM, the pull-based parser XMLReader is much easier to use than the xml_parser_* functions, and still doesn't require loading the file into memory.
