我想按父元素对节点进行分组。
这里的父元素是: FDDCell id="AAA" method="modify"
父元素重复两次。
我希望“FDDCell id”只出现一次。并将所有节点分组在“FDDCell id”下
这是 XML 输入文件:
<?xml version="1.0" encoding="UTF-8"?>
<start>
<FDDCell id="AAA" method="modify">
<UMTSFddNeighbouringCell id="FAR_AWAY" method="create">
<attributes>
<mbmsNeighbouringWeight>0.0</mbmsNeighbouringWeight>
</attributes>
</UMTSFddNeighbouringCell>
</FDDCell>
<FDDCell id="AAA" method="modify">
<attributes>
<cacConfId>RadioAccessService/0 DedicatedConf/0 CacConfClass/10</cacConfId>
<layerPreferredForR99>true</layerPreferredForR99>
<reserved0>1398341632</reserved0>
<reserved1>1398352896</reserved1>
<reserved2>1616994144</reserved2>
<reserved3>1616994144</reserved3>
</attributes>
</FDDCell>
</start>
这是所需的输出文件:
<?xml version="1.0" encoding="UTF-8"?>
<start>
<FDDCell id="AAA" method="modify">
<UMTSFddNeighbouringCell id="FAR_AWAY" method="create">
<attributes>
<mbmsNeighbouringWeight>0.0</mbmsNeighbouringWeight>
</attributes>
</UMTSFddNeighbouringCell>
<attributes>
<cacConfId>RadioAccessService/0 DedicatedConf/0 CacConfClass/10</cacConfId>
<layerPreferredForR99>true</layerPreferredForR99>
<reserved0>1398341632</reserved0>
<reserved1>1398352896</reserved1>
<reserved2>1616994144</reserved2>
<reserved3>1616994144</reserved3>
</attributes>
</FDDCell>
</start>
十分感谢您的支持