xsl-list
[Top] [All Lists]

Re: [xsl] Param value not getting value passed

2011-01-30 16:14:53
My guess is that your stylesheet is going through the built-in template rules, which do not pass simply-passed parameter values down. What you have coded only works if the template being invoked is invoked without the built-in template rules having been invoked in-between.

Note, however, that XSLT 2 supports tunnel parameters, which can be considered to be automatically passed through every <xsl:apply-templates> and every <xsl:call-template>, including built-in template rules, without having to say so explicitly.

So, if you are running XSLT 2, try:

   <xsl:with-param  name="group-value" tunnel="yes" select="16"/>

... and the corresponding:

   <xsl:param name="group-value" tunnel="yes" select="0"/>

BTW, you should note that:

  select="number(16)"

... is redundant because just "16" is also interpreted as a number, and that

  <xsl:param name="group-value">0</xsl:param>

... creates a variable of the type document tree with a root node and a text node with the character 0, whereas my use of the select attribute has the data type of number, which is what I think you are trying to use.

I hope this helps.

. . . . . . Ken

At 2011-01-30 15:05 -0700, Karl Stubsjoen wrote:
I'm perplexed.  I have a template match routine and param value that
is not receiving the param value passed.  I am passing the param value
like this:

<xsl:with-param name="group-value" select="number(16)"/>

The param is defined in the template match like this:
<xsl:param name="group-value">0</xsl:param>

The value is always:
type:ABC
value: "0"
(According to Oxygen)

I have a simple XML sample and the number param value is passed fine.
In my real example (working xml/xsl templates) it is not passed.  The
stylsheet is quite involved (over 30,000 lines).  I am stepping
through the code (I can provide screen shots) and the param value
default to the >0< "0" value.  Any ideas?  I have stepped through this
a 1/2 dozen times now!

Karl..

--
Karl Stubsjoen
MeetScoresOnline.com
(602) 845-0006


--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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