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.

Using concat in xpath to node that occurs more than once

reactancexl Posts: 159

I need to prepend and append brackets [] to my xpath result in a JSON databank. Below is what I am trying to do but it errors as the occurrence is more than once. The result I would like would look like this [434389]. I would take this result and put in writable. What is best way to handle this?



Best Answer

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    Answer ✓

    How about this?

    for $item in (/root/results/item/id/text())
    return concat("[", $item, "]")