XMLReader
PHP Manual

Die XMLReader Klasse

(PHP 5 >= 5.1.0, PHP 7)

Einführung

Die XMLReader-Erweiterung ist ein fortschreitender XML-Parser. Der Reader agiert wie ein Zeiger, der einen Datenstrom durchläuft und jeden vorbeikommenden Knoten der Reihe nach verarbeitet.

Klassenbeschreibung

XMLReader {
/* Konstanten */
const int NONE = 0 ;
const int ELEMENT = 1 ;
const int ATTRIBUTE = 2 ;
const int TEXT = 3 ;
const int CDATA = 4 ;
const int ENTITY_REF = 5 ;
const int ENTITY = 6 ;
const int PI = 7 ;
const int COMMENT = 8 ;
const int DOC = 9 ;
const int DOC_TYPE = 10 ;
const int DOC_FRAGMENT = 11 ;
const int NOTATION = 12 ;
const int WHITESPACE = 13 ;
const int SIGNIFICANT_WHITESPACE = 14 ;
const int END_ELEMENT = 15 ;
const int END_ENTITY = 16 ;
const int XML_DECLARATION = 17 ;
const int LOADDTD = 1 ;
const int DEFAULTATTRS = 2 ;
const int VALIDATE = 3 ;
const int SUBST_ENTITIES = 4 ;
/* Eigenschaften */
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 ;
/* Methoden */
public bool close ( void )
public DOMNode expand ([ DOMNode $basenode ] )
public string getAttribute ( string $name )
public string getAttributeNo ( int $index )
public string getAttributeNs ( string $localName , string $namespaceURI )
public bool getParserProperty ( int $property )
public bool isValid ( void )
public bool lookupNamespace ( string $prefix )
public bool moveToAttribute ( string $name )
public bool moveToAttributeNo ( int $index )
public bool moveToAttributeNs ( string $localName , string $namespaceURI )
public bool moveToElement ( void )
public bool moveToFirstAttribute ( void )
public bool moveToNextAttribute ( void )
public bool next ([ string $localname ] )
public bool open ( string $URI [, string $encoding [, int $options = 0 ]] )
public bool read ( void )
public string readInnerXML ( void )
public string readOuterXML ( void )
public string readString ( void )
public bool setParserProperty ( int $property , bool $value )
public bool setRelaxNGSchema ( string $filename )
public bool setRelaxNGSchemaSource ( string $source )
public bool setSchema ( string $filename )
public bool xml ( string $source [, string $encoding [, int $options = 0 ]] )
}

Eigenschaften

attributeCount

Anzahl der Attribute des aktuellen Knotens

baseURI

Die Basis URI des Knotens

depth

Tiefe des Knotens im Baum, beginnend mit 0

hasAttributes

Ob der Knoten Attribute besitzt

hasValue

Ob der Knoten einen Text-Wert besitzt

isDefault

Ob das Attribute als Standard aus der DTD übernommen wurde

isEmptyElement

Ob das Element leer ist

localName

Der lokale Name des Knotens

name

Der qualifizierte Name des Knotens

namespaceURI

Die URI des Namespaces, welcher mit dem Knoten assoziiert ist

nodeType

Der Typ des Knotens

prefix

Der Präfix, welcher mit dem Namespaces des Knotens assoziiert wird

value

Der Text-Wert des Knotens

xmlLang

Der xml:lang Scope des Knotens

Vordefinierte Konstanten

XMLReader Node Typen

XMLReader::NONE

Kein Typ

XMLReader::ELEMENT

Startendes Element

XMLReader::ATTRIBUTE

Attribut

XMLReader::TEXT

Text

XMLReader::CDATA

CDATA Abschnitt

XMLReader::ENTITY_REF

Entität-Referenz

XMLReader::ENTITY

Entität-Deklaration

XMLReader::PI

Verarbeitungsanweisung

XMLReader::COMMENT

Kommentar

XMLReader::DOC

Dokument Knoten

XMLReader::DOC_TYPE

Dokument Typ

XMLReader::DOC_FRAGMENT

Dokument Fragment Knoten

XMLReader::NOTATION

Notation

XMLReader::WHITESPACE

Leerzeichen

XMLReader::SIGNIFICANT_WHITESPACE

Signifikante Leerzeichen

XMLReader::END_ELEMENT

Schließendes Element

XMLReader::END_ENTITY

Entitätsende

XMLReader::XML_DECLARATION

XML Deklaration

XMLReader Parser Optionen

XMLReader::LOADDTD

DTD laden aber nicht validieren

XMLReader::DEFAULTATTRS

DTD und Standardattribute laden aber nicht validieren

XMLReader::VALIDATE

DTD laden und beim Parsen validieren

XMLReader::SUBST_ENTITIES

Entitäten ersetzen und Referenzen erweitern

Inhaltsverzeichnis


XMLReader
PHP Manual