任何人都可以帮助我了解每个不同包号的序列号的以下逻辑。输入:
<Move-Afile>
<Afile>
<Item>
<PackNumber>1234</PackNumber>
</Item>
<Item>
<PackNumber>1234</PackNumber>
</Item>
<Item>
<PackNumber>1234</PackNumber>
</Item>
<Item>
<PackNumber>126</PackNumber><!-- different PackNumber counter start from 1 -->
</Item>
<Item>
<PackNumber>126</PackNumber>
</Item>
<Item>
<PackNumber>135</PackNumber><!-- different PackNumber counter start from 1 -->
</Item>
<Item>
<PackNumber>135</PackNumber>
</Item>
</Afile>
</Move-Afile>
<Item>
是无界元素。对于每个 Item PackNumber 都存在。这里有一个条件,例如每个唯一<PackNumber>
的计数器应该从 1 开始并像下面的输出一样递增。
输出:
<?xml version="1.0"?>
<A>
<target>
<counter>1</counter>
<PNumber>1234</PNumber>
<counter>2</counter>
<PNumber>1234</PNumber>
<counter>3</counter>
<PNumber>1234</PNumber>
<counter>1</counter><!-- different PackNumber counter start from 1 -->
<PNumber>126</PNumber>
<counter>2</counter>
<PNumber>126</PNumber>
<counter>1</counter><!-- different PackNumber counter start from 1 -->
<PNumber>135</PNumber>
<counter>2</counter>
<PNumber>135</PNumber>
</target>
</A>