protected static function getParametersFromExpression(DOMNode $node, $expr)
	{
		$varNames   = XPathHelper::getVariables($expr);
		$paramNames = [];
		$xpath      = new DOMXPath($node->ownerDocument);
		foreach ($varNames as $name)
		{
			// Test whether this is the name of a local variable
			$query = 'ancestor-or-self::*/preceding-sibling::xsl:variable[@name="' . $name . '"]';
			if (!$xpath->query($query, $node)->length)
			{
				$paramNames[] = $name;
			}
		}

		return $paramNames;
	}
protected static function getParametersFromExpression(DOMNode $node, $expr)
	{
		$varNames   = XPathHelper::getVariables($expr);
		$paramNames = [];
		$xpath      = new DOMXPath($node->ownerDocument);
		foreach ($varNames as $name)
		{
			// Test whether this is the name of a local variable
			$query = 'ancestor-or-self::*/preceding-sibling::xsl:variable[@name="' . $name . '"]';
			if (!$xpath->query($query, $node)->length)
			{
				$paramNames[] = $name;
			}
		}

		return $paramNames;
	}
protected static function getParametersFromExpression ( DOMNode $ node , $ expr ) { $ varNames = XPathHelper :: getVariables ( $ expr ) ; $ paramNames = [ ] ; $ xpath = new DOMXPath ( $ node -> ownerDocument ) ; foreach ( $ varNames as $ name ) { // Test whether this is the name of a local variable $ query = 'ancestor-or-self::*/preceding-sibling::xsl:variable[@name="' . $ name . '"]' ; if ( ! $ xpath -> query ( $ query , $ node ) -> length ) { $ paramNames [ ] = $ name ; } } return $ paramNames ; }
Get a list of parameters from given XPath expression

@param  DOMNode  $node Context node
@param  string   $expr XPath expression
@return string[]
Get a list of parameters from given XPath expression