Documentation

XMLReader
in package

XML Reader wrapper.

Tags
since
0.2.1

Table of Contents

Properties

$dom  : DOMDocument
DOMDocument object.
$xpath  : DOMXpath
DOMXpath object.

Methods

countElements()  : int
Count elements.
elementExists()  : bool
Element exists.
getAttribute()  : null|string
Get element attribute.
getDomFromString()  : DOMDocument
Get DOMDocument from content string.
getDomFromZip()  : DOMDocument|false
Get DOMDocument from ZipArchive.
getElement()  : null|DOMElement
Get element.
getElements()  : DOMNodeList<string|int, DOMElement>
Get elements.
getValue()  : null|string
Get element value.
registerNamespace()  : bool
Registers the namespace with the DOMXPath object.

Properties

$dom

DOMDocument object.

private DOMDocument $dom

$xpath

DOMXpath object.

private DOMXpath $xpath

Methods

countElements()

Count elements.

public countElements(string $path[, DOMElement|null $contextNode = null ]) : int
Parameters
$path : string
$contextNode : DOMElement|null = null
Return values
int

elementExists()

Element exists.

public elementExists(string $path[, DOMElement|null $contextNode = null ]) : bool
Parameters
$path : string
$contextNode : DOMElement|null = null
Return values
bool

getAttribute()

Get element attribute.

public getAttribute(string $attribute[, DOMElement|null $contextNode = null ][, string $path = null ]) : null|string
Parameters
$attribute : string
$contextNode : DOMElement|null = null
$path : string = null
Return values
null|string

getDomFromString()

Get DOMDocument from content string.

public getDomFromString(string $content) : DOMDocument
Parameters
$content : string
Return values
DOMDocument

getDomFromZip()

Get DOMDocument from ZipArchive.

public getDomFromZip(string $zipFile, string $xmlFile) : DOMDocument|false
Parameters
$zipFile : string
$xmlFile : string
Return values
DOMDocument|false

getElement()

Get element.

public getElement(string $path[, DOMElement|null $contextNode = null ]) : null|DOMElement
Parameters
$path : string
$contextNode : DOMElement|null = null
Return values
null|DOMElement

getElements()

Get elements.

public getElements(string $path[, DOMElement|null $contextNode = null ]) : DOMNodeList<string|int, DOMElement>
Parameters
$path : string
$contextNode : DOMElement|null = null
Return values
DOMNodeList<string|int, DOMElement>

getValue()

Get element value.

public getValue(string $path[, DOMElement|null $contextNode = null ]) : null|string
Parameters
$path : string
$contextNode : DOMElement|null = null
Return values
null|string

registerNamespace()

Registers the namespace with the DOMXPath object.

public registerNamespace(string $prefix, string $namespaceURI) : bool
Parameters
$prefix : string

The prefix

$namespaceURI : string

The URI of the namespace

Return values
bool

true on success or false on failure


        
On this page

Search results