This package provides the functions to create stacks of objects, store them and recover them. The stack is built through a stack last-in-first-out (LIFO) of objects.

1 stack

The tag <stack> allows to create a new stack of objects. The function returns the newly created stack and you can pass to it one or more values in its creation. The stack name can be indicated through the attribute name or assign it to a variable.

<stack name='name'>
    <value /> *
</stack>
Example

Declarate and initialize some stacks of the 4 possible ways.

Copy
<xsql-script name='push_test'>
    <body>
        <!-- 1.- Stack created without value and with name -->
        <stack name='stack1' />     
        
        <set name='a'><number>10</number></set>
        <set name='b'><string>hello</string></set>

        <!-- 2.- Stack created with values and with name -->
        <stack name='stack2'><a/><b/></stack>

        <!-- 3.- Stack created without values assigned to a variable -->
        <set name='stack3'><stack/></set>
        
        <!-- 4.- Stack created with values assigned to a variable -->
        <set><stack><number>10</number><string>hello</string></stack></set>

    </body>
</xsql-script>