Copied!
  • noinspection PhpHierarchyChecksInspection
  • implements \IteratorAggregate<int, \DOMNode>
Cloneable Instantiable Iterable
Methods
public __call ( $name , $arguments )
 
public __construct ( DOMNode $node )
 
  • param DOMElement | DOMNode $node
public voku\helper\AbstractSimpleXmlDom :: __get ( $name )
 
  • param string $name
  • return array | string | null
public voku\helper\AbstractSimpleXmlDom :: __invoke ( $selector , $idx = NULL )
 
public voku\helper\AbstractSimpleXmlDom :: __isset ( $name )
 
  • param string $name
  • return bool
public voku\helper\AbstractSimpleXmlDom :: __set ( $name , $value )
 
public voku\helper\AbstractSimpleXmlDom :: __toString () : string
 
  • return string
public voku\helper\AbstractSimpleXmlDom :: __unset ( $name )
 
  • param string $name
  • return void
public childNodes ( int $idx = -1 )
 

Returns children of node.

public find ( string $selector , $idx = NULL )
 

Find list of nodes with a CSS or xPath selector.

public findMulti ( string $selector ) : voku\helper\SimpleXmlDomNodeInterface
 

Find nodes with a CSS or xPath selector.

public findMultiOrFalse ( string $selector )
 

Find nodes with a CSS or xPath selector.

public findOne ( string $selector ) : voku\helper\SimpleXmlDomInterface
 

Find one node with a CSS or xPath selector.

public findOneOrFalse ( string $selector )
 

Find one node with a CSS or xPath selector or false, if no element is found.

public firstChild ()
 

Returns the first child of node.

public getAllAttributes ()
 

Returns an array of attributes.

  • return string []| null
public getAttribute ( string $name ) : string
 

Return attribute value.

  • param string $name
  • return string
  • return string
public getElementByClass ( string $class ) : voku\helper\SimpleXmlDomNodeInterface
 

Return elements by ".class".

public getElementById ( string $id ) : voku\helper\SimpleXmlDomInterface
 

Return element by #id.

public getElementByTagName ( string $name ) : voku\helper\SimpleXmlDomInterface
 

Return element by tag name.

public getElementsById ( string $id , $idx = NULL )
 

Returns elements by "#id".

public getElementsByTagName ( string $name , $idx = NULL )
 

Returns elements by tag name.

public getIterator () : voku\helper\SimpleXmlDomNodeInterface
 

Retrieve an external iterator.

  • see http://php.net/manual/en/iteratoraggregate.getiterator.php
  • return voku\helper\SimpleXmlDomNode


    An instance of an object implementing Iterator or
    Traversable

public getNode () : DOMNode
 
  • return DOMNode
public getXmlDomParser () : voku\helper\XmlDomParser
 

Create a new "XmlDomParser"-object from the current context.

public hasAttribute ( string $name ) : bool
 

Determine if an attribute exists on the element.

  • param string $name
  • return bool
  • return bool
public hasAttributes () : bool
 
  • return bool
public innerHtml ( bool $multiDecodeNewHtmlEntity = false , bool $putBrokenReplacedBack = true ) : string
 

Get dom node's inner html.

  • param bool $multiDecodeNewHtmlEntity
  • param bool $putBrokenReplacedBack
  • return string
public innerXml ( bool $multiDecodeNewHtmlEntity = false ) : string
 

Get dom node's inner html.

  • param bool $multiDecodeNewHtmlEntity
  • return string
public isRemoved () : bool
 

Nodes can get partially destroyed in which they're still an
actual DOM node (such as \DOMElement) but almost their entire
body is gone, including the nodeType attribute.

  • return bool true if node has been destroyed
public lastChild ()
 

Returns the last child of node.

public nextNonWhitespaceSibling ()
 

Returns the next sibling of node.

public nextSibling ()
 

Returns the next sibling of node.

public parentNode () : voku\helper\SimpleXmlDomInterface
 

Returns the parent of node.

public previousNonWhitespaceSibling ()
 

Returns the previous sibling of node.

public previousSibling ()
 

Returns the previous sibling of node.

public removeAttribute ( string $name ) : voku\helper\SimpleXmlDomInterface
 

Remove attribute.

public setAttribute ( string $name , $value = NULL , bool $strictEmptyValueCheck = false ) : voku\helper\SimpleXmlDomInterface
 

Set attribute value.

  • param string $name
  • param string | null $value
  • param bool $strictEmptyValueCheck
  • return voku\helper\SimpleXmlDomInterface
  • param string | null $value

    Set to NULL or empty string, to remove the attribute.

  • param bool $strictEmptyValueCheck


    $value must be NULL, to remove the attribute,
    so that you can set an empty string as attribute-value e.g. autofocus=""

  • return voku\helper\SimpleXmlDomInterface
public text () : string
 

Get dom node's plain text.

  • return string
public val ( $value = NULL )
 
  • param string | string []| null $value


    null === get the current input value
    text === set a new input value

  • return string | string []| null
public xml ( bool $multiDecodeNewHtmlEntity = false ) : string
 

Get dom node's outer html.

  • param bool $multiDecodeNewHtmlEntity
  • return string
Properties
protected static voku\helper\AbstractSimpleXmlDom :: $functionAliases = [ 'children' => 'childNodes' , 'first_child' => 'firstChild' , 'last_child' => 'lastChild' , 'next_sibling' => 'nextSibling' , 'prev_sibling' => 'previousSibling' , 'parent' => 'parentNode' ]
 
  • var array
protected voku\helper\AbstractSimpleXmlDom :: $node
 
  • var DOMElement | DOMNode | null
Methods
protected changeElementName ( DOMNode $node , string $name )
 

Change the name of a tag in a "DOMNode".

  • param DOMNode $node
  • param string $name
  • return DOMElement | false

    DOMElement a new instance of class DOMElement or false
    if an error occured.

protected replaceChildWithString ( string $string , bool $putBrokenReplacedBack = true ) : voku\helper\SimpleXmlDomInterface
 

Replace child node.

protected replaceNodeWithString ( string $string ) : voku\helper\SimpleXmlDomInterface
 

Replace this node.

protected replaceTextWithString ( $string ) : voku\helper\SimpleXmlDomInterface
 

Replace this node with text

Methods
private normalizeStringForComparision ( $input ) : string
 

Normalize the given input for comparision.

Properties
protected static voku\helper\AbstractSimpleXmlDom :: $functionAliases = [ 'children' => 'childNodes' , 'first_child' => 'firstChild' , 'last_child' => 'lastChild' , 'next_sibling' => 'nextSibling' , 'prev_sibling' => 'previousSibling' , 'parent' => 'parentNode' ]
 
  • var array
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration