千家信息网

PHP扩展之XMLReader的示例分析

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,这篇文章给大家分享的是有关PHP扩展之XMLReader的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。一、概述及安装The XMLReader extension
千家信息网最后更新 2026年11月01日PHP扩展之XMLReader的示例分析

这篇文章给大家分享的是有关PHP扩展之XMLReader的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

一、概述及安装

The XMLReader extension is an XML Pull parser. The reader acts as a cursor going forward on the document stream and stopping at each node on the way.

It is important to note that internally, libxml uses the UTF-8 encoding and as such, the encoding of the retrieved contents will always be in UTF-8 encoding.

此扩展需要 libxml PHP 扩展。这表示需要使用 --enable-libxml ,尽管这将隐式完成因为 libxml 是缺省开启的。

The XMLReader extension was initially a PECL extension for PHP 5. It was later moved to the PHP source (bundled) as of PHP 5.1.0, and later enabled by default as of PHP 5.1.2.

此扩展默认为启用,编译时可通过下列选项禁用: --disable-xmlreader

二、XMLReader类及其成员函数

  • XMLReader::close - Close the XMLReader input

  • XMLReader::expand - Returns a copy of the current node as a DOM object

  • XMLReader::getAttribute - Get the value of a named attribute

  • XMLReader::getAttributeNo - Get the value of an attribute by index

  • XMLReader::getAttributeNs - Get the value of an attribute by localname and URI

  • XMLReader::getParserProperty - Indicates if specified property has been set

  • XMLReader::isValid - Indicates if the parsed document is valid

  • XMLReader::lookupNamespace - Lookup namespace for a prefix

  • XMLReader::moveToAttribute - Move cursor to a named attribute

  • XMLReader::moveToAttributeNo - Move cursor to an attribute by index

  • XMLReader::moveToAttributeNs - Move cursor to a named attribute

  • XMLReader::moveToElement - Position cursor on the parent Element of current Attribute

  • XMLReader::moveToFirstAttribute - Position cursor on the first Attribute

  • XMLReader::moveToNextAttribute - Position cursor on the next Attribute

  • XMLReader::next - Move cursor to next node skipping all subtrees

  • XMLReader::open - Set the URI containing the XML to parse

  • XMLReader::read - Move to next node in document

  • XMLReader::readInnerXML - Retrieve XML from current node

  • XMLReader::readOuterXML - Retrieve XML from current node, including it self

  • XMLReader::readString - Reads the contents of the current node as a string

  • XMLReader::setParserProperty - Set parser options

  • XMLReader::setRelaxNGSchema - Set the filename or URI for a RelaxNG Schema

  • XMLReader::setRelaxNGSchemaSource - Set the data containing a RelaxNG Schema

  • XMLReader::setSchema - Validate document against XSD

  • XMLReader::XML - Set the data containing the XML to parse

感谢各位的阅读!关于"PHP扩展之XMLReader的示例分析"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

示例 分析 内容 更多 篇文章 UTF-8 不错 实用 函数 成员 文章 看吧 知识 可通 参考 帮助 有关 编译 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网科技公司 云之行互联网科技 互联网科技行业发展 互联网巨头反垄断金融科技 互联网科技公司电话 互联网与新科技 小马过河互联网科技 互联网科技的未来发展 联恩商钥互联网科技有限公司 互联网科技公司的市场部门 互联网汽车科技小镇 世界互联网科技公司市值排名 智腾互联网科技有限公司 青岛科技大学互联网大赛研究生 高科技互联网发展前景如何 群盈汇互联网科技有限公司 上海创道互联网络科技有限公司 宇信科技在杭州互联网排第几 扫呗互联网科技有限公司 北京互联网科技类企业分布 互联网科技公司税收优惠 国外互联网科技网站 互联网科技创新企业排名 北京华百购互联网科技有限公司 互联网时代科技改变生活 2021世界互联网领先科技成果发布 深圳互联网科技园地址 山东蛋芒互联网科技有限公司 青岛互联网科技园 东风日产互联网科技公司叫什么
0