Reputation: 439
In a Logic Apps For Each, I am iterating over part of an XML document that has, in part:
<Part ref="1">
I want to read out the attribute value only. In this case, "1". I have tried:
xpath(xml(item()),'Part/@ref')
and I get
["ref=\"1\""]
With
first(xpath(xml(item()),'Part/@ref'))
I get
ref="1"
I have tried incorporating string() and value() functions to no avail. What is the proper way to read out just the value?
Upvotes: 1
Views: 4053
Reputation: 1474
You have to use this expression in Code View:
@xpath(xml(item()), 'string(/*[local-name()=\"Part\" and namespace-uri()=\"\"]/@*[local-name()=\"ref\" and namespace-uri()=\"\"])')
Upvotes: 0