PHP扩展之XML操作(四)——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扩展之XML操作(四)——XMLReader的内容,更多相关内容请关注PHP中文网(www.php.cn)!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

查看phpinfo()函数输出、使用命令行工具和检查PHP配置文件均可以查看php用了哪些扩展。1、查看phpinfo()函数输出,创建一个简单的PHP脚本,将这个脚本保存为phpinfo.php,并将其上传到您的Web服务器,在浏览器中访问此文件,使用浏览器的搜索功能,在页面中查找关键字"extension"或"extension_loaded",以找到有关扩展的信息即可。

如何使用PHP扩展PDO连接Oracle数据库导语:PHP是一种非常流行的服务器端编程语言,而Oracle是一款常用的关系型数据库管理系统。本文将介绍如何使用PHP扩展PDO(PHPDataObjects)来连接Oracle数据库。一、安装PDO_OCI扩展要连接Oracle数据库,首先需要安装PDO_OCI扩展。以下是安装PDO_OCI扩展的步骤:确保

如何使用PHP扩展SuiteCRM的报告生成功能SuiteCRM是一款功能强大的开源CRM系统,它提供了丰富的功能来帮助企业管理客户关系。其中一个重要的功能就是报告生成,使用报告可以帮助企业更好地了解业务情况,并作出正确的决策。本文将介绍如何使用PHP扩展SuiteCRM的报告生成功能,并提供相关的代码示例。在开始之前,需要确保已经安装好了SuiteCRM,

在使用PHP进行开发时,我们可能需要使用一些PHP扩展。这些扩展可以为我们提供更多的功能和工具,使我们的开发工作更加高效和便捷。但在使用这些扩展之前,我们需要先进行安装。本篇文章将为您介绍PHP扩展的安装方法。一、什么是PHP扩展?PHP扩展是指为PHP编程语言提供额外功能和服务的组件。这些组件可以通过PHP的扩展机制进行安装和使用。PHP扩展可以帮助我们处

宝塔面板是一款开源的服务器管理面板,在为网站运营者提供便捷的网站管理、数据库管理、SSL证书管理等服务的同时,还提供了强大的PHP扩展和PHP版本管理功能,让服务器管理变得更加简单和高效。一、PHP扩展PHP扩展是一种用来增强PHP功能的模块,通过安装PHP扩展可以实现更多的功能和服务,比如:加速器:加速器可以显著地提高PHP性能,通过缓存PHP脚本,减轻服

PHP是一种流行的服务器端脚本语言,它可以处理网页上的动态内容。PHP的geoip扩展可以让你在PHP中获取有关用户位置的信息。在本文中,我们将介绍如何使用PHP的geoip扩展。什么是PHP的GeoIP扩展?PHP的geoip扩展是一个免费的、开源的扩展,它允许你获取有关IP地址和位置信息的数据。该扩展可以与GeoIP数据库一起使用,这是一个由MaxMin

PHP扩展开发是创建自定义功能、扩展php核心功能并构建更强大的应用程序的艺术。它为PHP世界开辟了新的可能性,允许开发人员超越语言的基本限制。本文将带您踏上PHP扩展开发的旅程,从基础概念到高级技巧,为您提供全面的知识和实践指南。PHP扩展开发基础在开始PHP扩展开发之前,您需要了解一些基础概念。什么是PHP扩展?PHP扩展是一种动态链接库(DLL),它可以扩展PHP核心功能,提供新的数据类型、函数和类。PHP扩展的优点PHP扩展具有许多优点,包括:可扩展性、灵活性、性能优化和代码重用。PHP

教程:使用极光推送及其PHP扩展在应用中添加消息推送功能引言:在如今的移动应用开发中,消息推送功能已经成为了各类应用必不可少的一部分。而极光推送则是这方面最常用、最受开发者欢迎的解决方案之一。本教程将介绍如何使用极光推送及其PHP扩展来在应用中添加消息推送功能,并提供相应的代码示例供参考。一、极光推送简介极光推送是一款基于云服务的、跨平台的消息推送解决方案。
