Detect a special node in a XML file !
-
I have a XML file that its nodes have sorted by ID attribute .
<Information>
<Data ID="1" />
<Data ID="2" />
<Data ID="3" />
<Data ID="4" />
<Data ID="15" />
<Data ID="7" />
<Data ID="8" />
<Data ID="9" />
<Data ID="10" />
<Data ID="11" />
</Information>But there are some nodes in the XML file that broken this sorting. I'm going to detect them, but I don't know how I can do it ! e.g : in this case
<Data ID="15" />
broken the sorting. I don't want to sort them again, because the ID numbers are valuable and I shouldn't miss them. Could you guide me ? Thanks in advance. -
I have a XML file that its nodes have sorted by ID attribute .
<Information>
<Data ID="1" />
<Data ID="2" />
<Data ID="3" />
<Data ID="4" />
<Data ID="15" />
<Data ID="7" />
<Data ID="8" />
<Data ID="9" />
<Data ID="10" />
<Data ID="11" />
</Information>But there are some nodes in the XML file that broken this sorting. I'm going to detect them, but I don't know how I can do it ! e.g : in this case
<Data ID="15" />
broken the sorting. I don't want to sort them again, because the ID numbers are valuable and I shouldn't miss them. Could you guide me ? Thanks in advance.You are not clear on what you want to do. Do you want to: a) remove ID="15" ? b) find Data elements out of sequence? c) re-order? d) renumber?
'Howard
-
You are not clear on what you want to do. Do you want to: a) remove ID="15" ? b) find Data elements out of sequence? c) re-order? d) renumber?
'Howard
Thanks Howard. I want to remove ID="15"
-
Thanks Howard. I want to remove ID="15"
I assume (as you have not explained) that you want to fix the sequence so that it is correct. ID="15" is out-of-sequence but then so are all the remaining items after it. Unless your example is also wrong. Please explain your objectives.
'Howard