I have an input XML file which looks like this:
<Root>
<Monday>Monday<Monday>
<Indicator>true<Indicator>
<Value>1<Value>
<Tuesday>Tuesday<Tuesday>
<Indicator>true<Indicator>
<Value>2<Value>
<Wednesday>Wednesday<Wednesday>
<Indicator>true<Indicator>
<Value>3<Value>
</Root>
It must be converted to the output XML file which is:
<Root>
<Monday>Monday<Monday>
<Value>1<Value>
<Tuesday>Tuesday<Tuesday>
<Value>2<Value>
<Wednesday>Wednesday<Wednesday>
<Value>3<Value>
</Root>
The problem is that the input XML can vary. Sometimes it might be
<Root>
<Monday>Monday<Monday>
<Indicator>true<Indicator>
<Value>1<Value>
<Thursday>Thursday<Thursday>
<Indicator>true<Indicator>
<Value>4<Value>
</Root>
Now the output must be
<Root>
<Monday>Monday<Monday>
<Value>1<Value>
<Thursday>Thursday<Thursday>
<Value>4<Value>
</Root>
I also have the list of valid tags like Monday, Tuesday etc, which can come in the input XML in an ArrayList
in Java. Any ideas on how to accomplish this?