Re: [xsl] Parameters query

Subject: Re: [xsl] Parameters query
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sat, 27 Sep 2003 12:04:12 +0200
David Pratt wrote:
Thanks for reply. Am interested in passing in xml - just didn't know if
any limits or what you could pass and couldn't find much on it from the
standard.

There isn't anything in the XSLT spec because it's out of scope for it. The correct place to look for limits would be your processor's documentation or customer support (user mailing list).

If you want to pass XML, and *expect* it to be handled as
XML, you'll probably be disappointed: as I already said,
the spec defines no special handling for this, in particular,
if you pass a string resembling some XML (with markup) to
the processor, no processor will parse it by default and
provide you with a tree in the XSL style sheet.

To be more explicit: if you pass
  <foo><bar>stuff</bar></foo>
to parameter "foo",
you can't do this:
  <xsl:param name="foo"/>
  ...
  <xsl:value-of select="$foo/bar"/>
because $foo evaluates to the *string*
  "<foo><bar>stuff</bar></foo>"
and not to the tree
  foo
   +- bar
       +- "stuff"

Some processors have extension functions which allow you to
parse the string into a tree from within the XSLT. For other
processors, you can parse the string into a DOM before calling
the XSL transformer and pass the DOM object as parameter
(instead of the string).

None of this in in any way standardized, look into your
processor's docs for what you can do.

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread