Getting XML attribute

Hi Guys, I have the following response but am having difficulty retrieving the data I need to.

Here is the response:

<s:Envelope xmlns:s=“”>


    <XXX-CorrelationId xmlns="XXX">XXX-17a2089487f1</***-CorrelationId>

    <BGT-CorrelationSource xmlns="XXX">XXX-&gt;GetParameterValuesForKeyAndGroupListFull</XXX>



    <GetParameterValuesForKeyAndGroupListFullResponse xmlns="XXX">

        <GetParameterValuesForKeyAndGroupListFullResult xmlns:a="XXXX" xmlns:i="">

            <Session xmlns="">

                <AdditionalInfos i:nil="true" xmlns:b=""/>





                <StatusMessage i:nil="true"/>


            <StatusCode xmlns="XXX/2004/07/XXX_Globals_Objects">0</StatusCode>

            <StatusMessage xmlns="XXX2004/07/BGT_Globals_Objects">ST_GEN_OK</StatusMessage>

            <Timestamp xmlns="X/2004/07/BGT_Globals_ObjectsXX">2020-10-13T10:30:46.5952933+02:00</Timestamp>

            <a:Parameter xmlns:b="hXXX2003/10/Serialization/Arrays">






                            <b:Value xmlns:c="">



                                    <c:Annotation>Password required for login</c:Annotation>










This Response is resulting in just Two Nodes - the first one is the Header one, then the larger second one is Body (Goes on for much longer)

I am unable to get the element for Example in the last line, the “1” value.

Could someone advise on how to get the value for c:ParameterDefinitionsId in the last line for example?

Much appreciated!


Hope the following sample helps you. (15.2 KB)



as your XML is dealing with naespace @Yoichi has provided the demo handling this.

Find an approach on how to handle with config / mapping tables and doing the retrieval with the help of XPath:

1 Like

Thank you so much @Yoichi brilliant stuff. A bit for me to digest.

Could I ask a favour of how you would similarly use this string to find a value, where there are multiple instances of the original "xmlns:c and subsequent ParameterValuesId values…

sample.txt (11.7 KB)

I am trying to retrieve the specific value “100810866”. Not sure how I should be accessing the Key “<b:Key>node.failedLogins.number</b:Key>”

Much Appreciated!

Thanks a lot @ppr I shall look into this now!


The above your sample is not valid as xml. (eg. lack definition of b)
Can you share original xml as a file?


sample.xml (21.5 KB)

Apologies, see attached. I need to get the value “100810866”, and I can get it with your solution but also all of the other values with the same Namespace and Descendants…

Thanks in advance!


Can you try the following sample? (5.1 KB)


1 Like

Fantastic @Yoichi much appreciated! I couldn’t get this myself! Thanks again!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.