[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/s9e/text-formatter/src/Configurator/TemplateChecks/ -> DisallowUncompilableXSL.php (source)

   1  <?php declare(strict_types=1);
   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\TemplateChecks;
   9  
  10  use DOMElement;
  11  use RuntimeException;
  12  
  13  class DisallowUncompilableXSL extends AbstractXSLSupportCheck
  14  {
  15      protected $supportedElements = ['apply-templates', 'attribute', 'choose', 'comment', 'copy-of', 'element', 'if', 'otherwise', 'text', 'value-of', 'when'];
  16  
  17      protected $supportedFunctions = ['boolean', 'ceiling', 'concat', 'contains', 'count', 'current', 'false', 'floor', 'last', 'local-name', 'name', 'normalize-space', 'not', 'number', 'position', 'round', 'starts-with', 'string', 'string-length', 'substring', 'substring-after', 'substring-before', 'sum', 'system-property', 'translate', 'true'];
  18  
  19  	protected function checkXslCopyOfElement(DOMElement $copyOf): void
  20      {
  21          $expr = $copyOf->getAttribute('select');
  22          if (!preg_match('#^@[-\\w]+(?:\\s*\\|\\s*@[-\\w]+)*$#', $expr) && $expr !== '@*')
  23          {
  24              throw new RuntimeException("Unsupported xsl:copy-of expression '" . $expr . "'");
  25          }
  26      }
  27  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1