Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Get the values of two Data Elements with the same name

lukeliwanag
lukeliwanag Posts: 36

Hi All,

I am trying to grab the values of two tags with the same. See XML structure similar below:

1 2 </Data Set>

This XML Structure comes from context

Thanks for your help

Tagged:

Comments

  • OmarR
    OmarR Posts: 233 admin

    Hello Luke,
    What tool are you using to retrieve the values? XML databank?
    Have you tried using xpath: /DataSet/Value/text()

  • lukeliwanag
    lukeliwanag Posts: 36

    Hi Omar,

    Thank you for your suggestion. Another one would be these values are sometimes present sometimes not or sometimes there's only one how do we go about with that?

    Thank you

  • OmarR
    OmarR Posts: 233 admin
    edited May 2017

    There is a great example on how to handle repeated elements with missing values in the SOAtest userguide:

    The example can also be found in the help content within the tool. Try it out and let me know if you have any questions :)

  • lukeliwanag
    lukeliwanag Posts: 36

    Thanks @OmarR will try this and let you know.

  • lukeliwanag
    lukeliwanag Posts: 36

    Hi Omar,

    How would we extract these values using Java?