This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XML String as Parameter..
- From: "Joerg Heinicke" <joerg dot heinicke at gmx dot de>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 29 Mar 2002 14:55:13 +0100
- Subject: Re: [xsl] XML String as Parameter..
- References: <20020329133113.85022.qmail@web13604.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
document() is the wrong approach for using parameters. When you want to pass
a parameter 'test' to the stylesheet you have to add a global <xsl:param
name="test"/> to it:
<xsl:stylesheet version="1.0" xmlns:xsl="....">
<xsl:param name="test">default string</xsl:param>
</xsl:stylesheet>
If you now pass the parameter, test's value 'default string' will be
overwritten with the passed value and you can use it via <xsl:value-of
select="$test"/> anywhere in the templates.
document() is for getting whole XML documents. For example: <xsl:value-of
select="document('file.xml')"/> Or when using Cocoon 2 and the cocoon
protocol is known: document('cocoon://path/file').
Hope this helps,
Joerg
> Hi,
> I am able to pass the Parameter Now.
> But the Problem is that i cannot Load it into a
> variable using the document() function. It is Giving
> Error 'Cannot convert String in to Node List'.
>
> Any Solution for This
>
> Thanks,
> Ramesh
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list