Re: [xslt] Passing xml expressions as parameters.



On Wed, Jul 07, 2004 at 04:12:19PM -0400, Bob Stobie wrote:
What I would like is for the parameter to be treated the same way as the
global <xsl:variable>

Parameters in libxslt are strings, not trees.

? This is only true of top-level params, is it not? I am quite convinced that intra-stylesheet xsl:params can be result tree fragments, like any variable.


Adding a different type
would require a specific mechanism because as the example pointed out
allowing both is ambiguous.

I looked at the code, and I have to agree it is not a two-liner.

The spec says
  "XSLT does not define the mechanism by which parameters are passed to
   the stylesheet"
so this is a grey area.

Fair.

There is one perfectly standard way to get extra document
in an XSLT process which is by using the document() function.

Hmmm... If I may add my chime to this, I have a use case where I call a transformation from within another transformation. I would want to access fragments of the calling document from the stylesheet. I may call the substylesheet on many distinct fragments of the calling document, so access to the top-level document is not quite adequate.
Worse, the original document may be an in-memory document, generated on-the-fly, and hence has no URL that I could use to access it from the document function().


Maybe it's a more
general problem and solving this will help a lot of people, but it's
unclear right now.

Just wanted to add my +1 to this request.

Cheers,

Marc-Antoine Parent



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