Forum Discussion

Creditsafe_Supp's avatar
Creditsafe_Supp
Occasional Contributor
15 years ago

Transferring specific child elements out of an XML Response

Hi there

I would like to transfer a specific child element out of an XML response, now I know you can use the property transfer feature but I don't want the whole of the XML response just a specific child element/elements. Is there anyway I can achieve this?

Many thanks

6 Replies

  • Buschfunk's avatar
    Buschfunk
    Frequent Contributor
    Maybe you could use an XPath expression to get the specific child and then transfer this?

    Example:
    <root>
    <child>Child 1</child>
    <child>Child 2</child>
    <child>Child 3</child>
    </root>


    To get the 2nd child you could use the following expression:
    /root/child[2]


    Does that help?
  • Finan's avatar
    Finan
    Frequent Contributor
    you could also use (if you're set on using the property transfer) the "declare" button as shown in the example attached.
    The buttons marked in red are used to specify the desired child node. (note: not declaring adds the whole xml as input)
  • Creditsafe_Supp's avatar
    Creditsafe_Supp
    Occasional Contributor
    I can see what you're trying to explain but I'm still not having any success with it, but then my XPath isn't the greatest so it's probably me doing it wrong I believe it's probably not being declared properly
  • Creditsafe_Supp's avatar
    Creditsafe_Supp
    Occasional Contributor
    Is there any chance I could send you the response XML and highlight the element I want to extract?