您好,欢迎访问一九零五行业门户网

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的内容。
其它类似信息

推荐信息