
Announcements
We read a xml file and want to remove a tag, but everytime when the parent has an attribute the element can't be selected.
For example
<ParentNode att1="notempty" att2="notempty"/>
<childNode/>
</ParentNode>
We are using xpath query : ParentNode/childNode, but this query is not deleting or removing the child element.
Any solution?
Hi @Patrick83
Looks like there is a typo in the source XML text. It should be like:
<ParentNode att1="notempty" att2="notempty">
<childNode/>
</ParentNode>
As per my understanding, you want to fetch the childNode if ParentNode has a value in att1 attribute, to get that node pls use the below expression:
xpath(xml(outputs('Compose_3')),'ParentNode[@att1="notempty"]/childNode')
Pls replace outputs('Compose_3') with the actual valid xml input and attribute name & value as per you need.
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Thanks