public static function getParametersFromXSL($xsl)
	{
		$paramNames = [];
		$xpath      = new DOMXPath(TemplateLoader::load($xsl));

		// Start by collecting XPath expressions in XSL elements
		$query = '//xsl:*/@match | //xsl:*/@select | //xsl:*/@test';
		foreach ($xpath->query($query) as $attribute)
		{
			$expr        = $attribute->value;
			$paramNames += array_flip(self::getParametersFromExpression($attribute, $expr));
		}

		// Collect XPath expressions in attribute value templates
		$query = '//*[namespace-uri() != "' . self::XMLNS_XSL . '"]/@*[contains(., "{")]';
		foreach ($xpath->query($query) as $attribute)
		{
			foreach (AVTHelper::parse($attribute->value) as $token)
			{
				if ($token[0] === 'expression')
				{
					$expr        = $token[1];
					$paramNames += array_flip(self::getParametersFromExpression($attribute, $expr));
				}
			}
		}

		// Sort the parameter names and return them in a list
		ksort($paramNames);

		return array_keys($paramNames);
	}
public static function getParametersFromXSL($xsl)
	{
		$paramNames = [];
		$xpath      = new DOMXPath(TemplateLoader::load($xsl));

		// Start by collecting XPath expressions in XSL elements
		$query = '//xsl:*/@match | //xsl:*/@select | //xsl:*/@test';
		foreach ($xpath->query($query) as $attribute)
		{
			$expr        = $attribute->value;
			$paramNames += array_flip(self::getParametersFromExpression($attribute, $expr));
		}

		// Collect XPath expressions in attribute value templates
		$query = '//*[namespace-uri() != "' . self::XMLNS_XSL . '"]/@*[contains(., "{")]';
		foreach ($xpath->query($query) as $attribute)
		{
			foreach (AVTHelper::parse($attribute->value) as $token)
			{
				if ($token[0] === 'expression')
				{
					$expr        = $token[1];
					$paramNames += array_flip(self::getParametersFromExpression($attribute, $expr));
				}
			}
		}

		// Sort the parameter names and return them in a list
		ksort($paramNames);

		return array_keys($paramNames);
	}
public static function getParametersFromXSL ( $ xsl ) { $ paramNames = [ ] ; $ xpath = new DOMXPath ( TemplateLoader :: load ( $ xsl ) ) ; // Start by collecting XPath expressions in XSL elements $ query = '//xsl:*/@match | //xsl:*/@select | //xsl:*/@test' ; foreach ( $ xpath -> query ( $ query ) as $ attribute ) { $ expr = $ attribute -> value ; $ paramNames += array_flip ( self :: getParametersFromExpression ( $ attribute , $ expr ) ) ; } // Collect XPath expressions in attribute value templates $ query = '//*[namespace-uri() != "' . self :: XMLNS_XSL . '"]/@*[contains(., "{")]' ; foreach ( $ xpath -> query ( $ query ) as $ attribute ) { foreach ( AVTHelper :: parse ( $ attribute -> value ) as $ token ) { if ( $ token [ 0 ] === 'expression' ) { $ expr = $ token [ 1 ] ; $ paramNames += array_flip ( self :: getParametersFromExpression ( $ attribute , $ expr ) ) ; } } } // Sort the parameter names and return them in a list ksort ( $ paramNames ) ; return array_keys ( $ paramNames ) ; }
Return a list of parameters in use in given XSL

@param  string $xsl XSL source
@return array       Alphabetically sorted list of unique parameter names
Return a list of parameters in use in given XSL