文字

XML 解析器

  • 简介
  • 安装/配置
    • 需求
    • 安装
    • 运行时配置
    • 资源类型
  • 预定义常量
  • 事件处理器
  • Case Folding(大写转换)
  • 错误代码
  • 字符编码
  • 范例
    • XML 元素结构例程
    • XML 标签映射例程
    • XML 外部实体例程
  • XML 解析器函数
    • utf8_decode — 将用 UTF-8 方式编码的 ISO-8859-1 字符串转换成单字节的 ISO-8859-1 字符串。
    • utf8_encode — 将 ISO-8859-1 编码的字符串转换为 UTF-8 编码
    • xml_error_string — 获取 XML 解析器的错误字符串
    • xml_get_current_byte_index — 获取 XML 解析器的当前字节索引
    • xml_get_current_column_number — 获取 XML 解析器的当前列号
    • xml_get_current_line_number — 获取 XML 解析器的当前行号
    • xml_get_error_code — 获取 XML 解析器错误代码
    • xml_parse_into_struct — 将 XML 数据解析到数组中
    • xml_parse — 开始解析一个 XML 文档
    • xml_parser_create_ns — 生成一个支持命名空间的 XML 解析器
    • xml_parser_create — 建立一个 XML 解析器
    • xml_parser_free — 释放指定的 XML 解析器
    • xml_parser_get_option — 从 XML 解析器获取选项设置信息
    • xml_parser_set_option — 为指定 XML 解析进行选项设置
    • xml_set_character_data_handler — 建立字符数据处理器
    • xml_set_default_handler — 建立默认处理器
    • xml_set_element_handler — 建立起始和终止元素处理器
    • xml_set_end_namespace_decl_handler — 建立终止命名空间声明处理器
    • xml_set_external_entity_ref_handler — 建立外部实体指向处理器
    • xml_set_notation_decl_handler — 建立注释声明处理器
    • xml_set_object — 在对象中使用 XML 解析器
    • xml_set_processing_instruction_handler — 建立处理指令(PI)处理器
    • xml_set_start_namespace_decl_handler — 建立起始命名空间声明处理器
    • xml_set_unparsed_entity_decl_handler — 建立未解析实体定义声明处理器

用户评论:

[#1] marcgear at gmail dot com [2010-08-04 10:12:53]

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.

[#2] nat [2009-09-04 12:19:20]

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.

[#3] pavel dot lishin at gmail dot com [2009-07-28 09:33:54]

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 .

上一篇: 下一篇: