Global variables and recursive calls

Discussion in 'XML' started by Kevin Malone, Jan 13, 2004.

  1. Kevin Malone

    Kevin Malone Guest

    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.
    Kevin Malone, Jan 13, 2004
    #1
    1. Advertising

  2. Kevin Malone wrote:

    > 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
    Julian Reschke, Jan 13, 2004
    #2
    1. Advertising

  3. In article <cTXMb.46786$xy6.116300@attbi_s02>,
    Kevin Malone <> wrote:

    % 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.
    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Jan 14, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    3,841
  2. Replies:
    13
    Views:
    624
    Neil Cerutti
    Feb 15, 2007
  3. Joseph Wakeling
    Replies:
    9
    Views:
    490
    Ben Bacarisse
    Mar 5, 2006
  4. n00m
    Replies:
    12
    Views:
    1,101
  5. vamsi
    Replies:
    21
    Views:
    2,047
    Keith Thompson
    Mar 9, 2009
Loading...

Share This Page