XMLReader
in package
XML Reader wrapper.
Tags
Table of Contents
Properties
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
intelementExists()
Element exists.
public
elementExists(string $path[, DOMElement|null $contextNode = null ]) : bool
Parameters
- $path : string
- $contextNode : DOMElement|null = null
Return values
boolgetAttribute()
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|stringgetDomFromString()
Get DOMDocument from content string.
public
getDomFromString(string $content) : DOMDocument
Parameters
- $content : string
Return values
DOMDocumentgetDomFromZip()
Get DOMDocument from ZipArchive.
public
getDomFromZip(string $zipFile, string $xmlFile) : DOMDocument|false
Parameters
- $zipFile : string
- $xmlFile : string
Return values
DOMDocument|falsegetElement()
Get element.
public
getElement(string $path[, DOMElement|null $contextNode = null ]) : null|DOMElement
Parameters
- $path : string
- $contextNode : DOMElement|null = null
Return values
null|DOMElementgetElements()
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|stringregisterNamespace()
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