Returns the node which accomplish the xpath. If there is not, returns null. If there is several nodes who accomplish the xpath a exception is generated. The node can be passed as argument or as attribute.

1 dom.getElementByXPath

<dom.getElementByXPath
    name='name'
    xpath='xpath'
>
    <node /> ?
</dom.getElementByXPath>

Exceptions

Multiple elements returned by xpath.

There is more than 1 node who accomplish the xpath.

Example

Get the node of a specific xpath:

Copy
<xsql-script name='dom_getElementByXPath'>

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

        <!--
            Return:

        <object code="test" dbms="demo_utf8">pQ4WdpbmEgMQoK</object>
        -->
        <println>
            <dom.getElementByXPath xpath='/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:executeResponse/return/objresponse/object'>
                <root/>
            </dom.getElementByXPath>
        </println>

    </body>
</xsql-script>