[xslt] XSL parameter declaration using libxslt - expected behavior?



Question..  I'm using PHP 5.0.4 with the built-in libxslt-based xsl
extension. In PHP, I'm passing XSL parameters directly to the libxslt
processor like so:

$xslt_proc->setParameter('', 'param_test', "some test value");

My question is, is it *required* to declare this parameter in the XSL
stylesheet with:

<xsl:param name="param_test" />

What I have noticed is, the libxslt transformation is successful and
works the same whether I declare the parameter using xsl:param or not.
 The following:

<xsl:value-of select="$param_test"/>

works fine without the xsl:param declaration, the libxslt processor
does not give an error, and the parameter is available for use in the
stylesheet.

Shouldn't the xsl:param declaration be required and cause a
transformation error if it's missing?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]