xsl:param is for specifying parameter names (and default values)
immediately following a template declaration.
Hard to tell why your example is failing as you haven't supplied a full
working example.
Once you are inside the template you treat them as normal variables.
If your example is failing then it is probably because the element
immediately preceding your xsl:param
is not an xsl:template...
If your xsl:param statement is 'outside' all your templates - then it
is a global parameter
which will only get overridden by values passed to your XSLT process.
e.g.
xls:apply-template select='elements'
xsl:with-param name='v1' select='value of v1'/
/xsl:apply-templates
...
xsl:template match='elements'
xsl:param name='v1' select='/..'/
xsl:value-of select='$v1'/
/xsl:template
Any help?
Mike
Johan wrote:
Hi all...
I'm having trouble getting parameter values into my templates.
I specify the parameter like this :
xsl:apply-templates select=profile
xsl:with-param name=customerId
1234567890
/xsl:with-param
/xsl:apply-templates
And I try to read it like this:
xsl:param name=customerIdunknown/xsl:param
fo:block
xsl:value-of select=$customerId/
/fo:block
/xsl:template
But I always get 'unknown'. I've tried not specifying any value, but then the
parameter is empty.
I'm trying to loop through a nodelist and insert each element, and to do that I
need to either keep the context or pass in a parameter specifying the id. But i
havent managed to do either. I've seen lots of examples, and it all looks very
simple, but for some reason these values are not kept.
I'm using trax xsltc transformers, could that have anything to do with it?? (I'm
not getting any parser exceptions).
Does anyone have any idea??
Regards
/Johan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message Scanned by ClamAV on datalucid.com
--
Datalucid Limited
web: http://www.datalucid.com
Message Scanned by ClamAV on datalucid.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]