Find all child with -optional- comment and remove them
Posted: Tue Aug 20, 2019 10:41 am
Dear All,
I am trying to find and remove all children which has the optional part. Hence in this example, I would like to remove the descriptions.
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>
<!--Optional:-->
Two of our famous Belgian Waffles with plenty of real maple syrup
</description>
<description2>
<!--Optional:-->
Only for lactose intolerants
<description2>
<calories>650</calories>
</food>
At the end, my desired outcome is this:
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<calories>650</calories>
</food>
Is this possible with oxygen somehow?
Best Regards,
Andrew
I am trying to find and remove all children which has the optional part. Hence in this example, I would like to remove the descriptions.
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>
<!--Optional:-->
Two of our famous Belgian Waffles with plenty of real maple syrup
</description>
<description2>
<!--Optional:-->
Only for lactose intolerants
<description2>
<calories>650</calories>
</food>
At the end, my desired outcome is this:
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<calories>650</calories>
</food>
Is this possible with oxygen somehow?
Best Regards,
Andrew