protected function getExpressions(DOMElement $template)
	{
		$xpath = new DOMXPath($template->ownerDocument);
		$exprs = [];

		foreach ($xpath->query('//@*') as $attribute)
		{
			if ($attribute->parentNode->namespaceURI === self::XMLNS_XSL)
			{
				// Attribute of an XSL element. May or may not use XPath, but it shouldn't produce
				// false-positives
				$expr = $attribute->value;
				$exprs[$expr] = $attribute;
			}
			else
			{
				// Attribute of an HTML (or otherwise) element -- Look for inline expressions
				foreach (AVTHelper::parse($attribute->value) as $token)
				{
					if ($token[0] === 'expression')
					{
						$exprs[$token[1]] = $attribute;
					}
				}
			}
		}

		return $exprs;
	}
protected function getExpressions(DOMElement $template)
	{
		$xpath = new DOMXPath($template->ownerDocument);
		$exprs = [];

		foreach ($xpath->query('//@*') as $attribute)
		{
			if ($attribute->parentNode->namespaceURI === self::XMLNS_XSL)
			{
				// Attribute of an XSL element. May or may not use XPath, but it shouldn't produce
				// false-positives
				$expr = $attribute->value;
				$exprs[$expr] = $attribute;
			}
			else
			{
				// Attribute of an HTML (or otherwise) element -- Look for inline expressions
				foreach (AVTHelper::parse($attribute->value) as $token)
				{
					if ($token[0] === 'expression')
					{
						$exprs[$token[1]] = $attribute;
					}
				}
			}
		}

		return $exprs;
	}
protected function getExpressions ( DOMElement $ template ) { $ xpath = new DOMXPath ( $ template -> ownerDocument ) ; $ exprs = [ ] ; foreach ( $ xpath -> query ( '//@*' ) as $ attribute ) { if ( $ attribute -> parentNode -> namespaceURI === self :: XMLNS_XSL ) { // Attribute of an XSL element. May or may not use XPath, but it shouldn't produce // false-positives $ expr = $ attribute -> value ; $ exprs [ $ expr ] = $ attribute ; } else { // Attribute of an HTML (or otherwise) element -- Look for inline expressions foreach ( AVTHelper :: parse ( $ attribute -> value ) as $ token ) { if ( $ token [ 0 ] === 'expression' ) { $ exprs [ $ token [ 1 ] ] = $ attribute ; } } } } return $ exprs ; }
Get all the potential XPath expressions used in given template

@param  DOMElement $template <xsl:template/> node
@return array                XPath expression as key, reference node as value
Get all the potential XPath expressions used in given template