Copied!
  • property-read string $plaintext

    Get dom node's plain text.

Cloneable Instantiable
Methods
public voku\helper\AbstractDomParser :: __call ( $name , $arguments )
 
  • param string $name
  • param array $arguments
  • return bool | mixed
public static __callStatic ( $name , $arguments )
 
  • param string $name
  • param array $arguments
  • throws BadMethodCallException
  • throws RuntimeException
  • return static
  • param array $arguments
  • throws BadMethodCallException
  • throws RuntimeException
  • return static
public voku\helper\AbstractDomParser :: __clone ()
public __construct ( $element = NULL )
 
public __get ( $name )
 
  • param string $name
  • return string | null
  • return string | null
public __invoke ( $selector , $idx = NULL )
 
public __toString () : string
 
  • return string
public autoRegisterXPathNamespaces ( bool $autoRegisterXPathNamespaces = true ) : self
 
  • param bool $autoRegisterXPathNamespaces
  • return $this
public autoRemoveXPathNamespaces ( bool $autoRemoveXPathNamespaces = true ) : self
 
  • param bool $autoRemoveXPathNamespaces
  • return $this
public voku\helper\AbstractDomParser :: clear () : bool
 

does nothing (only for api-compatibility-reasons)

  • return bool
  • deprecated
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 or false, if no element is found.

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 fixHtmlOutput ( string $content , bool $multiDecodeNewHtmlEntity = false , bool $putBrokenReplacedBack = true ) : string
 
  • param string $content
  • param bool $multiDecodeNewHtmlEntity
  • param bool $putBrokenReplacedBack
  • return string
  • param bool $multiDecodeNewHtmlEntity
  • param bool $putBrokenReplacedBack
  • return string
public voku\helper\AbstractDomParser :: getDocument () : DOMDocument
 
  • return DOMDocument
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 html ( bool $multiDecodeNewHtmlEntity = false , bool $putBrokenReplacedBack = true ) : string
 

Get dom node's outer html.

  • param bool $multiDecodeNewHtmlEntity
  • param bool $putBrokenReplacedBack
  • return string
  • param bool $putBrokenReplacedBack
  • return string
public voku\helper\AbstractDomParser :: innerHtml ( bool $multiDecodeNewHtmlEntity = false , bool $putBrokenReplacedBack = true ) : string
 

Get dom node's inner html.

  • param bool $multiDecodeNewHtmlEntity
  • param bool $putBrokenReplacedBack
  • return string
public voku\helper\AbstractDomParser :: innerXml ( bool $multiDecodeNewHtmlEntity = false ) : string
 

Get dom node's inner html.

  • param bool $multiDecodeNewHtmlEntity
  • return string
public loadHtml ( string $html , $libXMLExtraOptions = NULL ) : voku\helper\DomParserInterface
 

Load HTML from string.

public loadHtmlFile ( string $filePath , $libXMLExtraOptions = NULL ) : voku\helper\DomParserInterface
 

Load HTML from file.

  • param string $filePath
  • param int | null $libXMLExtraOptions
  • throws RuntimeException
  • return voku\helper\DomParserInterface
  • param int | null $libXMLExtraOptions
  • throws RuntimeException
  • return $this
public loadXml ( string $xml , $libXMLExtraOptions = NULL ) : self
 

Load XML from string.

  • param string $xml
  • param int | null $libXMLExtraOptions
  • return $this
public loadXmlFile ( string $filePath , $libXMLExtraOptions = NULL ) : self
 

Load XML from file.

  • param string $filePath
  • param int | null $libXMLExtraOptions
  • throws RuntimeException
  • return $this
public static voku\helper\AbstractDomParser :: putReplacedBackToPreserveHtmlEntities ( string $html , bool $putBrokenReplacedBack = true ) : string
 
  • param string $html
  • return string
public replaceTextWithCallback ( $callback , ? DOMNode $domNode = NULL )
 
  • param callable $callback
  • param DOMNode | null $domNode
  • return void
public static voku\helper\AbstractDomParser :: replaceToPreserveHtmlEntities ( string $html ) : string
 
  • param string $html
  • return string
public reportXmlErrorsAsException ( bool $reportXmlErrorsAsException = true ) : self
 
  • param bool $reportXmlErrorsAsException
  • return $this
public voku\helper\AbstractDomParser :: save ( string $filepath = '' ) : string
 

Save the html-dom as string.

  • param string $filepath
  • return string
public voku\helper\AbstractDomParser :: set_callback ( $functionName )
 
  • param callable $functionName
  • phpstan-param callable(\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser): void $functionName
  • return void
public setCallbackBeforeCreateDom ( callable $callbackBeforeCreateDom ) : self
 
  • param callable $callbackBeforeCreateDom
  • phpstan-param callable(string $xmlString, \voku\helper\XmlDomParser): string $callbackBeforeCreateDom
  • return $this
public setCallbackXPathBeforeQuery ( callable $callbackXPathBeforeQuery ) : self
 
  • param callable $callbackXPathBeforeQuery
  • phpstan-param callable(string $cssSelectorString, string $xPathString, \DOMXPath, \voku\helper\XmlDomParser): string $callbackXPathBeforeQuery
  • return $this
public voku\helper\AbstractDomParser :: text ( bool $multiDecodeNewHtmlEntity = false ) : string
 

Get dom node's plain text.

  • param bool $multiDecodeNewHtmlEntity
  • return string
public voku\helper\AbstractDomParser :: xml ( bool $multiDecodeNewHtmlEntity = false , bool $htmlToXml = true , bool $removeXmlHeader = true , int $options = 4 LIBXML_NOEMPTYTAG) : string
 

Get the HTML as XML or plain XML if needed.

  • param bool $multiDecodeNewHtmlEntity
  • param bool $htmlToXml
  • param bool $removeXmlHeader
  • param int $options
  • return string
Properties
protected static voku\helper\AbstractDomParser :: $callback
 
  • var callable | null
  • phpstan-var null|callable(\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser): void
protected voku\helper\AbstractDomParser :: $document
 
  • var DOMDocument
protected static voku\helper\AbstractDomParser :: $domBrokenReplaceHelper
 
  • var array
protected static voku\helper\AbstractDomParser :: $domHtmlBrokenHtmlHelper = '____simple_html_dom__voku__broken_html____'
 
  • var string
protected static voku\helper\AbstractDomParser :: $domHtmlSpecialScriptHelper = '____simple_html_dom__voku__html_special_script____'
 
  • var string
protected static voku\helper\AbstractDomParser :: $domHtmlWrapperHelper = '____simple_html_dom__voku__html_wrapper____'
 
  • var string
protected static voku\helper\AbstractDomParser :: $domLinkReplaceHelper = [ 'orig' => [ '[' , ']' , '{' , '}' ] , 'tmp' => [ '____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_LEFT____' , '____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_RIGHT____' , '____SIMPLE_HTML_DOM__VOKU__BRACKET_LEFT____' , '____SIMPLE_HTML_DOM__VOKU__BRACKET_RIGHT____' ] ]
 
  • var string []
protected static voku\helper\AbstractDomParser :: $domReplaceHelper = [ 'orig' => [ '&' , '|' , '+' , '%' , '@' , '<html ⚡' ] , 'tmp' => [ '____SIMPLE_HTML_DOM__VOKU__AMP____' , '____SIMPLE_HTML_DOM__VOKU__PIPE____' , '____SIMPLE_HTML_DOM__VOKU__PLUS____' , '____SIMPLE_HTML_DOM__VOKU__PERCENT____' , '____SIMPLE_HTML_DOM__VOKU__AT____' , '<html ____SIMPLE_HTML_DOM__VOKU__GOOGLE_AMP____="true"' ] ]
 
  • var string []
protected voku\helper\AbstractDomParser :: $encoding
 
  • var string
protected static voku\helper\AbstractDomParser :: $functionAliases
 
  • var string []
Methods
protected createDOMDocument ( string $xml , $libXMLExtraOptions = NULL ) : DOMDocument
 

Create DOMDocument from XML.

  • param string $html
  • param int | null $libXMLExtraOptions
  • return DOMDocument
  • param int | null $libXMLExtraOptions
  • return DOMDocument
protected voku\helper\AbstractDomParser :: decodeHtmlEntity ( string $content , bool $multiDecodeNewHtmlEntity ) : string
 
  • param string $content
  • param bool $multiDecodeNewHtmlEntity
  • return string
protected voku\helper\AbstractDomParser :: getEncoding () : string
 

Get the encoding to use.

  • return string
protected voku\helper\AbstractDomParser :: html5FallbackForScriptTags ( string $html )
 
  • param string $html
  • return void
Properties
private $autoRegisterXPathNamespaces
 
  • var bool
private $autoRemoveXPathNamespaces
 
  • var bool
private $callbackBeforeCreateDom
 
  • var callable | null
  • phpstan-var null|callable(string $xmlString, \voku\helper\XmlDomParser): string
private $callbackXPathBeforeQuery
 
  • var callable | null
  • phpstan-var null|callable(string $cssSelectorString, string $xPathString, \DOMXPath, \voku\helper\XmlDomParser): string
private $reportXmlErrorsAsException
 
  • var bool
private $xPathNamespaces
 
  • var string []
  • phpstan-var array<string, string>
Methods
private removeXPathNamespaces ( string $xml ) : string
 
  • param string $xml
  • return string
Properties
protected static voku\helper\AbstractDomParser :: $callback
 
  • var callable | null
  • phpstan-var null|callable(\voku\helper\XmlDomParser|\voku\helper\HtmlDomParser): void
protected static voku\helper\AbstractDomParser :: $domBrokenReplaceHelper
 
  • var array
protected static voku\helper\AbstractDomParser :: $domHtmlBrokenHtmlHelper = '____simple_html_dom__voku__broken_html____'
 
  • var string
protected static voku\helper\AbstractDomParser :: $domHtmlSpecialScriptHelper = '____simple_html_dom__voku__html_special_script____'
 
  • var string
protected static voku\helper\AbstractDomParser :: $domHtmlWrapperHelper = '____simple_html_dom__voku__html_wrapper____'
 
  • var string
protected static voku\helper\AbstractDomParser :: $domLinkReplaceHelper = [ 'orig' => [ '[' , ']' , '{' , '}' ] , 'tmp' => [ '____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_LEFT____' , '____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_RIGHT____' , '____SIMPLE_HTML_DOM__VOKU__BRACKET_LEFT____' , '____SIMPLE_HTML_DOM__VOKU__BRACKET_RIGHT____' ] ]
 
  • var string []
protected static voku\helper\AbstractDomParser :: $domReplaceHelper = [ 'orig' => [ '&' , '|' , '+' , '%' , '@' , '<html ⚡' ] , 'tmp' => [ '____SIMPLE_HTML_DOM__VOKU__AMP____' , '____SIMPLE_HTML_DOM__VOKU__PIPE____' , '____SIMPLE_HTML_DOM__VOKU__PLUS____' , '____SIMPLE_HTML_DOM__VOKU__PERCENT____' , '____SIMPLE_HTML_DOM__VOKU__AT____' , '<html ____SIMPLE_HTML_DOM__VOKU__GOOGLE_AMP____="true"' ] ]
 
  • var string []
protected static voku\helper\AbstractDomParser :: $functionAliases
 
  • var string []
Methods
public static __callStatic ( $name , $arguments )
 
  • param string $name
  • param array $arguments
  • throws BadMethodCallException
  • throws RuntimeException
  • return static
  • param array $arguments
  • throws BadMethodCallException
  • throws RuntimeException
  • return static
public static voku\helper\AbstractDomParser :: putReplacedBackToPreserveHtmlEntities ( string $html , bool $putBrokenReplacedBack = true ) : string
 
  • param string $html
  • return string
public static voku\helper\AbstractDomParser :: replaceToPreserveHtmlEntities ( string $html ) : string
 
  • param string $html
  • return string
© 2022 Bruce Wells
Search Namespaces \ Classes
Configuration