Returns a NodeList with all the elements of the indicated tagname in those that have been found in a transversal preorder of the Document Tree. The node can be passed as argument or as attribute.
 

1 dom.getElementsByTagName

<dom.getElementsByTagName
    name='name'
    tagname='tagname'
>
    <node /> ?
</dom.getElementsByTagName>
Example

Get the list of the nodes with the specified tag.

Copy
<xsql-script name='dom_getElementsByTagName'>
    <body>
        <set name='root'>
            <dom.parse><string><elements><element>hello</element><element>world</element></elements></string></dom.parse>
        </set>

        <set name='elems'>
            <dom.getElementsByTagName tagname='element'>
                <root/>
            </dom.getElementsByTagName>
        </set>
        <set name='arrsize'><array.size name='elems' /></set>
        <for name='i' start='1' end='#arrsize'>
            <do>
                <set name='firstelemvalue'>
                    <dom.node.getNodeValue>
                        <dom.node.getFirstChild>
                            <array.get name='elems'><sub><i /><number>1</number></sub></array.get>
                        </dom.node.getFirstChild>
                    </dom.node.getNodeValue>
                </set>
                <println><firstelemvalue/></println>
            </do>
        </for>
    </body>
</xsql-script>