ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
enshrined\svgSanitize\data\XPath Class Reference
+ Inheritance diagram for enshrined\svgSanitize\data\XPath:
+ Collaboration diagram for enshrined\svgSanitize\data\XPath:

Public Member Functions

 __construct (\DOMDocument $doc)
 
 createNodeName ($nodeName)
 

Data Fields

const DEFAULT_NAMESPACE_PREFIX = 'svg'
 

Protected Member Functions

 handleDefaultNamespace ()
 

Protected Attributes

 $defaultNamespaceURI
 

Detailed Description

Definition at line 4 of file XPath.php.

Constructor & Destructor Documentation

◆ __construct()

enshrined\svgSanitize\data\XPath::__construct ( \DOMDocument  $doc)

Definition at line 13 of file XPath.php.

14 {
15 parent::__construct($doc);
17 }

References enshrined\svgSanitize\data\XPath\handleDefaultNamespace().

+ Here is the call graph for this function:

Member Function Documentation

◆ createNodeName()

enshrined\svgSanitize\data\XPath::createNodeName (   $nodeName)
Parameters
string$nodeName
Returns
string

Definition at line 23 of file XPath.php.

24 {
25 if (empty($this->defaultNamespaceURI)) {
26 return $nodeName;
27 }
28 return self::DEFAULT_NAMESPACE_PREFIX . ':' . $nodeName;
29 }

◆ handleDefaultNamespace()

enshrined\svgSanitize\data\XPath::handleDefaultNamespace ( )
protected

Definition at line 31 of file XPath.php.

32 {
33 $rootElements = $this->getRootElements();
34
35 if (count($rootElements) !== 1) {
36 throw new \LogicException(
37 sprintf('Got %d svg elements, expected exactly one', count($rootElements)),
38 1570870568
39 );
40 }
41 $this->defaultNamespaceURI = (string)$rootElements[0]->namespaceURI;
42
43 if ($this->defaultNamespaceURI !== '') {
44 $this->registerNamespace(self::DEFAULT_NAMESPACE_PREFIX, $this->defaultNamespaceURI);
45 }
46 }

Referenced by enshrined\svgSanitize\data\XPath\__construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $defaultNamespaceURI

enshrined\svgSanitize\data\XPath::$defaultNamespaceURI
protected

Definition at line 11 of file XPath.php.

◆ DEFAULT_NAMESPACE_PREFIX

const enshrined\svgSanitize\data\XPath::DEFAULT_NAMESPACE_PREFIX = 'svg'

Definition at line 6 of file XPath.php.


The documentation for this class was generated from the following file: