PHP Class Box\Spout\Reader\Wrapper\SimpleXMLElement

.. Instead, it is used as a passthrough.
See also: SimpleXMLElement
Inheritance: use trait Box\Spout\Reader\Wrapper\XMLInternalErrorsHelper
Show file Open project: box/spout Class Usage Examples

Protected Properties

Property Type Description
$simpleXMLElement Instance of the wrapped SimpleXMLElement object

Public Methods

Method Description
__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

Protected Methods

Method Description
wrapSimpleXMLElement ( SimpleXMLElement $element ) : SimpleXMLElement | null Wraps the given element into an instance of the wrapper

Method Details

__construct() public method

Creates a new SimpleXMLElement object
See also: SimpleXMLElement::__construct
public __construct ( string $xmlData )
$xmlData string A well-formed XML string

__toString() public method

public __toString ( ) : string
return string

getAttribute() public method

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
return string | null The attribute value or NULL if attribute not found

getFirstChildByTagName() public method

Returns the first child matching the given tag name
public getFirstChildByTagName ( string $tagName ) : SimpleXMLElement | null
$tagName string
return SimpleXMLElement | null The first child matching the tag name or NULL if none found

registerXPathNamespace() public method

Creates a prefix/ns context for the next XPath query
See also: 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.
return boolean TRUE on success or FALSE on failure.

removeNodesMatchingXPath() public method

It does not map to any \SimpleXMLElement function.
public removeNodesMatchingXPath ( string $path ) : void
$path string An XPath path
return void

wrapSimpleXMLElement() protected method

Wraps the given element into an instance of the wrapper
protected wrapSimpleXMLElement ( SimpleXMLElement $element ) : SimpleXMLElement | null
$element SimpleXMLElement Element to be wrapped
return SimpleXMLElement | null The wrapped element or NULL if the given element is invalid

xpath() public method

Runs XPath query on XML data
See also: SimpleXMLElement::xpath
public xpath ( string $path ) : SimpleXMLElement[] | boolean
$path string An XPath path
return SimpleXMLElement[] | boolean an array of SimpleXMLElement objects or FALSE in case of an error.

Property Details

$simpleXMLElement protected property

Instance of the wrapped SimpleXMLElement object
protected $simpleXMLElement