Driver XPath Get XML element value

I have the XML response in Driver's local variable 'lv-Result'.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.partner.soap.sforce.com">
    <soapenv:Header>
        <LimitInfoHeader>
            <limitInfo>
                <current>142795</current>
                <limit>49754000</limit>
                <type>API REQUESTS</type>
            </limitInfo>
        </LimitInfoHeader>
    </soapenv:Header>
    <soapenv:Body>
        <queryAllResponse>
            <result xsi:type="QueryResult">
                <done>true</done>
                <queryLocator xsi:nil="true"/>
                <records xsi:type="sf:sObject">
                    <sf:type>User</sf:type>
                    <sf:Id>005030000040AQeAAM</sf:Id>
                    <sf:Id>005030000040AQeAAM</sf:Id>
                </records>
                <size>1</size>
            </result>
        </queryAllResponse>
    </soapenv:Body>
</soapenv:Envelope>

I want to get the value of <sf:Id>005030000040AQeAAM</sf:Id> and <size>1</size>, please help here.

I tried the below XPath in Driver's local variable as String but got an error.

$lv-Result/*[local-name()="soapenv:Envelope"]/*[local-name()="soapenv:Body"]/queryAllResponse/result/size/text()

I am using IDM 4.7.3.

Parents Reply Children
  • 0   in reply to 

    In Designer, you could flip to the XMLview, in the <policy> node, add this text inside the node like:
    <policy xmlns:sf="urn:sobject.partner.soap.sforce.com"?

    Or you could click the Namespace button on the Policy page where you use this XPATH expression (upper right, it is next to the Simulate button)

    And define the first field as sf and then the second field as urn:sobject.partner.soap.sforce.com