Global variables and recursive calls

K

Kevin Malone

Is it possible to update a global variable passed via a parameter in
'call-template' that is recursive, or does that create a circular reference?
I seem to be able to update only a local variable with the same name but may
not have the syntax right.
 
J

Julian Reschke

Kevin said:
Is it possible to update a global variable passed via a parameter in
'call-template' that is recursive, or does that create a circular reference?
I seem to be able to update only a local variable with the same name but may
not have the syntax right.

You can't "update" a variable at all. Once a value was assigned, it's
read-only.

Julian
 
P

Patrick TJ McPhee

% Is it possible to update a global variable passed via a parameter in
% 'call-template' that is recursive, or does that create a circular reference?

It's not clear to me what you mean, but this allows you to call a template
recursively while preserving the value of the parameter `parm-name':

<xsl:call-template name='template-name'>
<xsl:with-param name='parm-name' select='$parm-name'/>
</xsl:call-template>

It will work whether the parameter is defined in the template or at
the style sheet level, but the parameter must be in scope.

You may want to ask your question again, including a short example of
what you're trying to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top