The tag <stack.peek> returns the last object stored in the stack without removing it from it. The stack can be indicated via the attribute name or passing it as argument.

1 stack.peek

<stack.peek name='name'>
    <stack /> ?

Initialize the execution stack with two values and obtain them through the tag stack.peek.

<xsql-script name='peek_test'>

        <stack name='stack1'><number>10</number><string>hello</string></stack>
        <!-- The stack is not altered  -->
        <set name='a'><stack.peek name='stack1' /></set>

        <!-- hello -->

        <!-- Extraction of the object which is in the top of the stack, it is the same than before because the peek does not remove the stack. -->
        <set name='b'><stack.peek><stack1/></stack.peek></set>

        <!-- hello -->