protected function generateAttributes(array $attributes) { if (isset($attributes['style']) && \is_array($attributes['style'])) { $attributes['style'] = $this->generateStyle($attributes['style']); } \ksort($attributes); $xsl = ''; foreach ($attributes as $attrName => $attrValue) { $innerXML = \strpos($attrValue, '<xsl:') !== \false ? $attrValue : AVTHelper::toXSL($attrValue); $xsl .= '<xsl:attribute name="' . \htmlspecialchars($attrName, \ENT_QUOTES, 'UTF-8') . '">' . $innerXML . '</xsl:attribute>'; } return $xsl; }
/** * @testdox toXSL() tests * @dataProvider getToXSLTests */ public function testToXSL($attrValue, $expected) { $this->assertSame($expected, AVTHelper::toXSL($attrValue)); }