我有以下xml:
<Candidate:candidateInfo>
<Candidate:name> AAA</Candidate:name>
<Candidate:age>16</Candidate:age>
<Candidate:sex>M</Candidate:sex>
</Candidate:candidateInfo>
<Candidate:candidateInfo>
<Candidate:name> BBB</Candidate:name>
<Candidate:age>28</Candidate:age>
<Candidate:sex>F</Candidate:sex>
</Candidate:candidateInfo>
<Candidate:candidateInfo>
<Candidate:name>CCC</Candidate:name>
<Candidate:age>28</Candidate:age>
<Candidate:sex>M</Candidate:sex>
</Candidate:candidateInfo>
我需要按候选年龄的升序对节点进行排序。在 3 个排序值中,如果相应的年龄大于 18,我必须从中值(3 个中的第 2 个)元素填充所有信息。否则我有填充元素 3 中的值。