Returns the element who is immediately before the indicated node. If there is not, returns null. The node can be passed as argument or as attribute.

1 dom.element.getPreviousSiblingElement

<dom.element.getPreviousSiblingElement name='name'>
    <node /> ?
</dom.element.getPreviousSiblingElement>
Example

Get the node of the element type immediately before the root node of the file.

Copy
<xsql-script name='dom_node_getPreviousSiblingElement'>

    <body>
        <set name='root'>
            <dom.parse><file name='data.xml' type='absolute' /></dom.parse>
        </set>

        <!-- It is situated in the element with the text hello. -->
        <set name='elem1'>
            <dom.element.getFirstChildElement>
                <root/>
            </dom.element.getFirstChildElement>
        </set>

        <set name='elem2'>
            <dom.element.getNextSiblingElement>
                <elem1/>
            </dom.element.getNextSiblingElement>
        </set>

        <!-- Return:  <element>world</element> -->
        <println>
            <elem2/>
        </println>

        <!-- Return:  <element>hello</element> -->
        <println>
            <dom.element.getPreviousSiblingElement>
                <elem2/>
            </dom.element.getPreviousSiblingElement>
        </println>

    </body>
</xsql-script>