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

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

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

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. Wayne
    Replies:
    2
    Views:
    649
    Wayne
    Nov 11, 2003
  2. Replies:
    3
    Views:
    4,182
  3. Honne Gowda A
    Replies:
    2
    Views:
    1,103
    Karl Heinz Buchegger
    Oct 31, 2003
  4. Replies:
    13
    Views:
    790
    Neil Cerutti
    Feb 15, 2007
  5. Joseph Wakeling
    Replies:
    9
    Views:
    691
    Ben Bacarisse
    Mar 5, 2006
  6. n00m
    Replies:
    12
    Views:
    1,320
  7. vamsi
    Replies:
    21
    Views:
    2,450
    Keith Thompson
    Mar 9, 2009
  8. king
    Replies:
    2
    Views:
    334
    Tad McClellan
    Jun 27, 2006
Loading...