[ Index ]

PHP Cross Reference of phpBB-3.3.12-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Configurator/TemplateNormalizations/ -> NormalizeAttributeNames.php (source)

   1  <?php
   2  
   3  /**
   4  * @package   s9e\TextFormatter
   5  * @copyright Copyright (c) 2010-2022 The s9e authors
   6  * @license   http://www.opensource.org/licenses/mit-license.php The MIT License
   7  */
   8  namespace s9e\TextFormatter\Configurator\TemplateNormalizations;
   9  
  10  use DOMAttr;
  11  use DOMElement;
  12  
  13  class NormalizeAttributeNames extends AbstractNormalization
  14  {
  15      /**
  16      * {@inheritdoc}
  17      */
  18      protected $queries = [
  19          '//@*[name() != translate(name(), "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")]',
  20          '//xsl:attribute[not(contains(@name, "{"))][@name != translate(@name, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")]'
  21      ];
  22  
  23      /**
  24      * {@inheritdoc}
  25      */
  26  	protected function normalizeAttribute(DOMAttr $attribute)
  27      {
  28          $attribute->parentNode->setAttribute($this->lowercase($attribute->localName), $attribute->value);
  29          $attribute->parentNode->removeAttributeNode($attribute);
  30      }
  31  
  32      /**
  33      * {@inheritdoc}
  34      */
  35  	protected function normalizeElement(DOMElement $element)
  36      {
  37          $element->setAttribute('name', $this->lowercase($element->getAttribute('name')));
  38      }
  39  }


Generated: Sun Jun 23 12:25:44 2024 Cross-referenced by PHPXref 0.7.1