XMLReader
PHP Manual

La classe XMLReader

Introduction

L'extension XMLReader est un analyseur XML. L'analyseur fonctionne comme un curseur qui parcourt le document et s'arrête sur chaque noeud.

Synopsis de la classe

XMLReader
XMLReader {
/* Constantes */
const int XMLReader::NONE =0 ;
const int XMLReader::ELEMENT =1 ;
const int XMLReader::ATTRIBUTE =2 ;
const int XMLReader::TEXT =3 ;
const int XMLReader::CDATA =4 ;
const int XMLReader::ENTITY_REF =5 ;
const int XMLReader::ENTITY =6 ;
const int XMLReader::PI =7 ;
const int XMLReader::COMMENT =8 ;
const int XMLReader::DOC =9 ;
const int XMLReader::DOC_TYPE =10 ;
const int XMLReader::DOC_FRAGMENT =11 ;
const int XMLReader::NOTATION =12 ;
const int XMLReader::WHITESPACE =13 ;
const int XMLReader::END_ELEMENT =15 ;
const int XMLReader::END_ENTITY =16 ;
const int XMLReader::LOADDTD =1 ;
const int XMLReader::DEFAULTATTRS =2 ;
const int XMLReader::VALIDATE =3 ;
/* Propriétés */
public readonly int $attributeCount ;
public readonly string $baseURI ;
public readonly int $depth ;
public readonly bool $hasAttributes ;
public readonly bool $hasValue ;
public readonly bool $isDefault ;
public readonly bool $isEmptyElement ;
public readonly string $localName ;
public readonly string $name ;
public readonly string $namespaceURI ;
public readonly int $nodeType ;
public readonly string $prefix ;
public readonly string $value ;
public readonly string $xmlLang ;
/* Méthodes */
bool XMLReader::close ( void )
DOMNode XMLReader::expand ( void )
string XMLReader::getAttribute ( string $name )
string XMLReader::getAttributeNo ( int $index )
string XMLReader::getAttributeNs ( string $localName , string $namespaceURI )
bool XMLReader::getParserProperty ( int $property )
bool XMLReader::isValid ( void )
bool XMLReader::lookupNamespace ( string $prefix )
bool XMLReader::moveToAttribute ( string $name )
bool XMLReader::moveToAttributeNo ( int $index )
bool XMLReader::moveToAttributeNs ( string $localName , string $namespaceURI )
bool XMLReader::next ([ string $localname ] )
bool XMLReader::open ( string $URI [, string $encoding [, int $options ]] )
bool XMLReader::read ( void )
string XMLReader::readInnerXML ( void )
string XMLReader::readOuterXML ( void )
string XMLReader::readString ( void )
bool XMLReader::setParserProperty ( int $property , bool $value )
bool XMLReader::setRelaxNGSchema ( string $filename )
bool XMLReader::setRelaxNGSchemaSource ( string $source )
boolean XMLReader::setSchema ( string $filename )
bool XMLReader::xml ( string $source [, string $encoding [, int $options ]] )
}

Propriétés

attributeCount

Le nombre d'attributs dans le noeud

baseURI

La base URI du noeud

depth

Profondeur du noeud dans l'arbre démarrant à 0

hasAttributes

Indique si le noeud a des attributs

hasValue

Indique si le noeud a une valeur de texte

isDefault

Indique si l'attribut est par défaut à partir du DTD

isEmptyElement

Indique si le noeud est un élément vide

localName

Le nom local du noeud

name

Le noeud qualifié du noeud

namespaceURI

L'URI de l'espace de nom associé avec le noeud

nodeType

Le type de noeud pour le noeud

prefix

Le préfixe de l'espace de nom associé avec le noeud

value

La valeur du texte du noeud

xmlLang

La portée xml:lang dans lequel le noeud réside

Constantes pré-définies

Types de noeud XMLReader

XMLReader::NONE

Pas de type de noeud

XMLReader::ELEMENT

Élément de départ

XMLReader::ATTRIBUTE

Noeud Attribut

XMLReader::TEXT

Noeud texte

XMLReader::CDATA

Noeud CDATA

XMLReader::ENTITY_REF

Noeud de référence d'entité

XMLReader::ENTITY

Noeud de déclaration d'entité

XMLReader::PI

Noeud d'instruction de processus

XMLReader::COMMENT

Noeud de commentaire

XMLReader::DOC

Noeud document

XMLReader::DOC_TYPE

Noeud de type de document

XMLReader::DOC_FRAGMENT

Noeud de fragment de document

XMLReader::NOTATION

Noeud de notation

XMLReader::WHITESPACE

Noeud "espace"

XMLReader::SIGNIFICANT_WHITESPACE

Noeud "espace" significatif

XMLReader::END_ELEMENT

Élément de fin

XMLReader::END_ENTITY

Entité de fin

XMLReader::XML_DECLARATION

Noeud de déclaration XML

Options de l'analyseur XMLReader

XMLReader::LOADDTD

Charge une DTD mais ne la valide pas

XMLReader::DEFAULTATTRS

Charge une DTD et les attributs par défaut mais ne la valide pas

XMLReader::VALIDATE

Charge une DTD et valide le document au moment de l'analyse

XMLReader::SUBST_ENTITIES

Substitue les entités et étend les références

Sommaire


XMLReader
PHP Manual