0 votes
1 view
in RPA by (12.8k points)

I am attempting to select a node based on a value in an element in an XML file that contains a namespace.

I am using Automation Anywhere's Get XML Node command that limits me to using a single line XPath statement.

This is the sample XML file

<IMPORT xmlns="urn:Import">

    <STUFF>

        <STUFF_TYPE>

            <STUFF_TYPE_KEY>1</STUFF_TYPE_KEY>

        </STUFF_TYPE>

        <WALMART>

            <STORE>

                <STORE_ID TYPE="SC" ID="SC-12345">WM000001</STORE_ID>

                <STORE_STATUS>O</STORE_STATUS>

            </STORE>

        </WALMART> 

    </STUFF>

</IMPORT>

I would like to select the STORE_STATUS value where STORE_ID = WM000001

Right now, it is not finding the node.

1 Answer

0 votes
by (29.8k points)

Hi, you can try using the following code below it should work

//*[local-name() = 'STORE']/*[local-name() = 'STORE_ID' and text() = 'WM000001']/following-sibling::*[local-name() = 'STORE_STATUS']

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...