xsl-list
[Top] [All Lists]

Re: stylesheet params - static vs dynamic

2004-06-27 14:46:45
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


<Prev in Thread] Current Thread [Next in Thread>