I've got an XML with a structure like the following;
<items>
<item>5</item>
<item>3006</item>
<item>25</item>
<item>458</item>
<item>15</item>
<item>78</item>
</items>
How do I delete the item with the value 458. Just to clarify this, I don't know the index of that item, so simply calling delete items[index] won't do here. I have to delete by value.
Any hints?
this should solve it. Btw this will delete all direct chilren with name "item" that have value 458.
delete xml.(item == "458");
To delete recursively all children and subchildren that have name "item" and value 458 use:
delete xml..(item == "458");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With