Основы PHP
  Что такое PHP?
  Возможности PHP
  Преимущества PHP
  История развития
  Что нового в PHP5?
  «Движок» PHP
  Переход на PHP 5.3
New Переход на PHP 5.6
  Введение в PHP
  Изучение PHP
  Основы CGI
  Синтаксис PHP
  Типы данных PHP
  Переменные в PHP
  Константы PHP
  Выражения PHP
  Операторы PHP
  Конструкции PHP
  Ссылки в PHP
  PHP и ООП
  Безопасность
  Функции PHP
  Функции по категориям
  Функции по алфавиту
  Стандартные функции
  Пользовательские
  PHP и HTTP
  Работа с формами
  PHP и Upload
  PHP и Cookies
  PHP и базы данных
  PHP и MySQL
  Документация MySQL
  Учебники
  Учебники по PHP
  Учебники по MySQL
  Другие учебники
  Уроки PHP
  Введение
  Самые основы
  Управление
  Функции
  Документация
  Математика
  Файлы
  Основы SQL
  Дата и время
  CURL
  Изображения
  Стили
  Безопасность
  Установка
  Проектирование БД
  Регулярные выражения
  Подготовка к работе
  Быстрый старт
  Установка PHP
  Установка MySQL
  Конфигурация PHP
  Download / Скачать
  Скачать Apache
  Скачать PHP
  Скачать PECL
  Скачать PEAR
  Скачать MySQL
  Редакторы PHP
  Полезные утилиты
  Документация
  PHP скрипты
  Скачать скрипты
  Инструменты
  PHP в примерах
  Новости портала
 Главная   »  Функции PHP
 
 

XMLReader functions

Введение

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.

Установка

The XMLReader extension is available in PECL for PHP 5.0 and is included in PHP 5.1 by default. It and can be enabled by adding the argument --with--xmlreader to your configure line. The libxml extension is required.

Предопределенные классы

XMLReader

Методы

Свойства

Таблица 1.

NameTypeRead-onlyDescription
attributeCountintyesThe number of attributes on the node
baseURIstringyesThe base URI of the node
depthintyesDepth of the node in the tree starting at 0
hasAttributesboolyesIndicates if node has attributes
hasValueboolyesIndicates if node has a text value
isDefaultboolyesIndicates if attribute is defaulted from DTD
isEmptyElementboolyesIndicates if node is an empty element tag
localNamestringyesThe local name of the node
namestringyesThe qualified name of the node
namespaceURIstringyesThe URI of the namespace associated with the node
nodeTypeintyesThe node type for the node
prefixstringyesThe prefix of the namespace associated with the node
valuestringyesThe text value of the node
xmlLangstringyesThe xml:lang scope which the node resides

Предопределенные константы

Перечисленные ниже константы определены данным расширением и могут быть доступны только в том случае, если PHP был собран с поддержкой этого расширения или же в том случае, если данное расширение подгружается во время выполнения.

Таблица 2. XMLReader Node Types

ConstantValueDescription
XMLREADER_NONE (integer) 0No node type
XMLREADER_ELEMENT (integer) 1Start element
XMLREADER_ATTRIBUTE (integer) 2Attribute node
XMLREADER_TEXT (integer) 3Text node
XMLREADER_CDATA (integer) 4CDATA node
XMLREADER_ENTITY_REF (integer) 5Entity Reference node
XMLREADER_ENTITY (integer) 6Entity Declaration node
XMLREADER_PI (integer) 7Processing Instruction node
XMLREADER_COMMENT (integer) 8Comment node
XMLREADER_DOC (integer) 9Document node
XMLREADER_DOC_TYPE (integer) 10Document Type node
XMLREADER_DOC_FRAGMENT (integer) 11Document Fragment node
XMLREADER_NOTATION (integer) 12Notation node
XMLREADER_WHITESPACE (integer) 13Whitespace node
XMLREADER_SIGNIFICANT_WHITESPACE (integer) 14Significant Whitespace node
XMLREADER_END_ELEMENT (integer) 15End Element
XMLREADER_END_ENTITY (integer) 16End Entity
XMLREADER_XML_DECLARATION (integer) 17XML Declaration node

Таблица 3. XMLReader Parser Options

ConstantValueDescription
XMLREADER_LOADDTD (integer) 1Load DTD but do not validate
XMLREADER_DEFAULTATTRS (integer) 2Load DTD and default attributes but do not validate
XMLREADER_VALIDATE (integer) 3Load DTD and validate while parsing
XMLREADER_SUBST_ENTITIES (integer) 4Subsitute entities and expand references

Содержание

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->setParserProperty() -- Set or Unset parser options
XMLReader->setRelaxNGSchema() -- Set the filename or URI for a RelaxNG Schema
XMLReader->setRelaxNGSchemaSource() -- Set the data containing a RelaxNG Schema
XMLReader->XML() -- Set the data containing the XML to parse
 
 
 Функции по алфавиту 
   Содержание   
 Функции по категориям 
Есть еще вопросы или что-то непонятно - добро пожаловать на наш  форум портала PHP.SU 
 

 
Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS