基于计数位于不同节点的元素名称。我想给出唯一但序列号。 输入数据
<record>
`enter code here` <items>
<list code="a"> item location </list>
<list code="b"> 123 </list>
</items>
<items>
<list code="a"> item location </list>
<list code="b"> 123 </list>
</items>
</record>
期望的输出
<record>
<items>
<list code="a"> item location </list>
<list code="b">1 </list>
</items>
<items>
<list code="a"> item location </list>
<list code="b"> 2 </list>
</items>
</record>