Re: [xsl] stylesheet params - static vs dynamic

Subject: Re: [xsl] stylesheet params - static vs dynamic
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sun, 27 Jun 2004 23:46:45 +0200
Jasthi, Siva R. wrote:
I am trying to come up with a generic stylesheet that can print the
"name - value" pairs of the parameters it is given.

Is there anyway to know dynamically
(a) what are the names of the parameters and

<xsl:for-each select="document('')/*/xsl:param/@name"> <xsl:value-of select="."/> </xsl:for-each> Note that this isn't bullet-proof in some environments for a wide variety of reasons.

(b) what are the values of those parameters
inside a stylesheet?

You can get the default values the same way as the names, but getting the actually assigned values ought to require double evaluation, which can't be done with standard XPath 1.0 only. If you are willing to use an extension function, check your processor's documentation for "evaluate" or something similar.

J.Pietschmann

Current Thread