Documentation

XMLReader
in package

XML Reader wrapper

Tags
since
0.10.0

Table of Contents

Properties

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

Methods

countElements()  : int
Count elements
elementExists()  : bool
Element exists
getAttribute()  : string|null
Get element attribute
getDomFromString()  : DOMDocument
Get DOMDocument from content string
getDomFromZip()  : DOMDocument|false
Get DOMDocument from ZipArchive
getElement()  : DOMElement|null
Get element
getElements()  : DOMNodeList|array<string|int, mixed>
Get elements
getValue()  : string|null
Get element value

Properties

$dom

DOMDocument object

private DOMDocument $dom = null

$xpath

DOMXpath object

private DOMXpath $xpath = null

Methods

countElements()

Count elements

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

elementExists()

Element exists

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

getAttribute()

Get element attribute

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

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
Tags
throws
Exception
Return values
DOMDocument|false

getElement()

Get element

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

getElements()

Get elements

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

getValue()

Get element value

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

Search results