From the following XML file, I want to remove "ColumnBlocks" tag based on one condition. Condition is- If the value of the FixedFloat tag is Float, then I want to delete ColumnBlocks tag from XML. My XML is -
<?xml version="1.0" encoding="UTF-8"?>
<FirstTag>
<SecondTag>
<CategoryGroups>
<Group>
<Category>
<PricingDetails>
<SimplePricingDetails>
<FixedFloat>Fixed</FixedFloat>
</SimplePricingDetails>
</PricingDetails>
<rowVolume>
<ColumnBlocks>
<ColumnBlock>
<Column>abcd</Column>
</ColumnBlock>
<ColumnBlock>
<Column>xyz</Column>
</ColumnBlock>
</ColumnBlocks>
</rowVolume>
<row>jsdf<row>
</Category>
<Category>
<PricingDetails>
<SimplePricingDetails>
<FixedFloat>Float</FixedFloat>
</SimplePricingDetails>
</PricingDetails>
<rowVolume>
<ColumnBlocks>
<ColumnBlock>
<Column>abcd</Column>
</ColumnBlock>
<ColumnBlock>
<Column>xyz</Column>
</ColumnBlock>
</ColumnBlocks>
</rowVolume>
<row>jsdf<row>
</Category>
</Group>
</CategoryGroups>
</SecondTag>
</FirstTag>
I want the final code to not have ColumnBlocks from the Category, where FixedFloat value is Float. It should look like the below XML -
<?xml version="1.0" encoding="UTF-8"?>
<FirstTag>
<SecondTag>
<CategoryGroups>
<Group>
<Category>
<PricingDetails>
<SimplePricingDetails>
<FixedFloat>Fixed</FixedFloat>
</SimplePricingDetails>
</PricingDetails>
<rowVolume>
<ColumnBlocks>
<ColumnBlock>
<Column>abcd</Column>
</ColumnBlock>
<ColumnBlock>
<Column>xyz</Column>
</ColumnBlock>
</ColumnBlocks>
</rowVolume>
<row>jsdf<row>
</Category>
<Category>
<PricingDetails>
<SimplePricingDetails>
<FixedFloat>Float</FixedFloat>
</SimplePricingDetails>
</PricingDetails>
<rowVolume>
</rowVolume>
<row>jsdf<row>
</Category>
</Group>
</CategoryGroups>
</SecondTag>
</FirstTag>
<FixedFloat>Float</FixedFloat>and then ignore that node<FixedFloat>is equal to Float.