首頁  >  文章  >  後端開發  >  PHP擴充之XML操作(四)-XMLReader

PHP擴充之XML操作(四)-XMLReader

黄舟
黄舟原創
2017-02-13 15:03:192601瀏覽

一、概述與安裝


一、概述及安裝

The XMLReader extension is an XML Pull parser. The reader acts as a cursor going forward on the document at pum stop the stop. 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.35.1.2.此擴充認為啟用,編譯時可透過下列選項停用: --disable-xmlreader

二、XMLReader類別及其成員函數

XMLReader::close — Close the XMLReader input

XMLReader::close — Close the XMLReader input
  • XMLReader::closecom a copy of the current node as a DOM object

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

  • XMLReader::getAttribute

  • XMLReader:: 。
  • XMLReader: :lookupNamespace — Lookup namespace for a prefix
  • XMLReader::moveToAttribute — Move cursor to a named attribute
  • XMLReader atntribute
  • XMLReader::moveToAttributeNs — Move cursor to a named attribute
  • XMLReader::moveToElement — Position cursor on the parent Element of current Attribute
  • XMLReader::movemoveFirstdmove
  • XMLReader::moveToNextAttribute — Position cursor on the next Attribute
  • XMLReader::next — Move cursor to next node skipping all subtrees
  • XMLReader::open — Set the URI containing in document
  • XMLReader::readInnerXML — Retrieve XML from current node
  • XMLReader::readOuterXML — Retrieve contents of the current node as a string
  • XMLReader::setParserProperty — Set parser options
  • XMLReader::setRelaxNGSchema — Set the NGname or URIs for ajidwhio Set the data containing a RelaxNG Schema
  • XMLReader::setSchema — Validate document against XSD
  • XMLReader::XML — Set the data containing the XML to parse
  • (Re相關內容請關注PHP中文網(www.php.cn)!
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn