Let's say we have this simple XML
structure:
<myXML>
<data>
<column value="1" />
<column value="2" />
<column value="3" />
<column value="4" />
<column value="5" />
<column value="6" />
<column value="7" />
<column value="8" />
<column value="9" />
<column value="10" />
</data>
<data>
<column value="1" />
<column value="2" />
<column value="3" />
<column value="4" />
<column value="5" />
<column value="6" />
</data>
<data>
<column value="3" />
<column value="4" />
<column value="5" />
<column value="6" />
<column value="7" />
</data>
</myXML>
I need to remove all nodes from a specific list of values, for example (1,4,6,8,9), by using the XML
modify
statement.
Right now I'm using the following statement (it is build dynamically):
myXML.modify('delete for $Node in /data/column where ($Node/[@value=1]) or ($Node/[@value=3]) or ($Node/[@value=4]) return $Node')
But when I have big list of values it slows down the performance of my query. Is there any other way to do this?