PHP Класс Box\Spout\Reader\Wrapper\SimpleXMLElement

.. Instead, it is used as a passthrough.
См. также: SimpleXMLElement
Наследование: use trait Box\Spout\Reader\Wrapper\XMLInternalErrorsHelper
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$simpleXMLElement Instance of the wrapped SimpleXMLElement object

Открытые методы

Метод Описание
__construct ( string $xmlData ) Creates a new SimpleXMLElement object
__toString ( ) : string
getAttribute ( string $name, string | null | void $namespace = null ) : string | null Returns the attribute for the given name.
getFirstChildByTagName ( string $tagName ) : SimpleXMLElement | null Returns the first child matching the given tag name
registerXPathNamespace ( string $prefix, string $namespace ) : boolean Creates a prefix/ns context for the next XPath query
removeNodesMatchingXPath ( string $path ) : void Remove all nodes matching the given XPath query.
xpath ( string $path ) : SimpleXMLElement[] | boolean Runs XPath query on XML data

Защищенные методы

Метод Описание
wrapSimpleXMLElement ( SimpleXMLElement $element ) : SimpleXMLElement | null Wraps the given element into an instance of the wrapper

Описание методов

__construct() публичный Метод

Creates a new SimpleXMLElement object
См. также: SimpleXMLElement::__construct
public __construct ( string $xmlData )
$xmlData string A well-formed XML string

__toString() публичный Метод

public __toString ( ) : string
Результат string

getAttribute() публичный Метод

Returns the attribute for the given name.
public getAttribute ( string $name, string | null | void $namespace = null ) : string | null
$name string Attribute name
$namespace string | null | void An optional namespace for the retrieved attributes
Результат string | null The attribute value or NULL if attribute not found

getFirstChildByTagName() публичный Метод

Returns the first child matching the given tag name
public getFirstChildByTagName ( string $tagName ) : SimpleXMLElement | null
$tagName string
Результат SimpleXMLElement | null The first child matching the tag name or NULL if none found

registerXPathNamespace() публичный Метод

Creates a prefix/ns context for the next XPath query
См. также: SimpleXMLElement::registerXPathNamespace
public registerXPathNamespace ( string $prefix, string $namespace ) : boolean
$prefix string The namespace prefix to use in the XPath query for the namespace given in "namespace".
$namespace string The namespace to use for the XPath query. This must match a namespace in use by the XML document or the XPath query using "prefix" will not return any results.
Результат boolean TRUE on success or FALSE on failure.

removeNodesMatchingXPath() публичный Метод

It does not map to any \SimpleXMLElement function.
public removeNodesMatchingXPath ( string $path ) : void
$path string An XPath path
Результат void

wrapSimpleXMLElement() защищенный Метод

Wraps the given element into an instance of the wrapper
protected wrapSimpleXMLElement ( SimpleXMLElement $element ) : SimpleXMLElement | null
$element SimpleXMLElement Element to be wrapped
Результат SimpleXMLElement | null The wrapped element or NULL if the given element is invalid

xpath() публичный Метод

Runs XPath query on XML data
См. также: SimpleXMLElement::xpath
public xpath ( string $path ) : SimpleXMLElement[] | boolean
$path string An XPath path
Результат SimpleXMLElement[] | boolean an array of SimpleXMLElement objects or FALSE in case of an error.

Описание свойств

$simpleXMLElement защищенное свойство

Instance of the wrapped SimpleXMLElement object
protected $simpleXMLElement