如果名称重复,我如何删除类型包的节点。我的意思是应该保留第一次出现,而应该删除其他的。看到 package_one 名称在包节点中重复
<?xml version="1.0"?>
<coverage branch-rate="0.53968253968278" branch-total="50" line-rate="0.66864343958488" line-total="2000" timestamp="1346297959" version="gcovr 2.3">
<sources>
<source>
./.
</source>
</sources>
<packages>
<package branch-rate="0.52380952380967" branch-total="15" line-rate="0.75148257968866" line-total="1000" complexity="0.0" name="package_one">
<classes>
<class branch-rate="0.0" complexity="0.0" filename="eBayBotAPI.cpp" line-rate="0.0" name="BotAPI.cpp">
<lines>
<line branch="false" hits="0" number="128" condition-coverage="100%"/>
<line branch="false" hits="0" number="192" condition-coverage="100%"/>
</lines>
</class>
</classes>
<class branch-rate="0.5" complexity="0.0" filename="good.cpp" line-rate="1.0" name="good1.cpp">
<lines>
<line branch="false" hits="96" number="8" condition-coverage="100%"/>
</lines>
</class></package>
<package branch-rate="0.571428571429" branch-total="10" complexity="0.0" line-rate="0.00593031875463" line-total="1000" name="package_one">
<classes>
<class branch-rate="0.0" complexity="0.0" filename="eBayBotAPI.cpp" line-rate="0.0" name="BotAPI.cpp">
<lines>
<line branch="false" hits="0" number="128" condition-coverage="100%"/>
</lines>
</class>
</classes>
</package>
</packages>
预期的:
<?xml version="1.0"?>
<coverage branch-rate="0.53968253968278" branch-total="50" line-rate="0.66864343958488" line-total="2000" timestamp="1346297959" version="gcovr 2.3">
<sources>
<source>
./.
</source>
</sources>
<packages><package branch-rate="0.52380952380967" branch-total="15" line-rate="0.75148257968866" line-total="1000" complexity="0.0" name="package_one"><classes>
<class branch-rate="0.0" complexity="0.0" filename="eBayBotAPI.cpp" line-rate="0.0" name="BotAPI.cpp">
<lines>
<line branch="false" hits="0" number="128" condition-coverage="100%"/>
<line branch="false" hits="0" number="192" condition-coverage="100%"/>
</lines>
</class>
</classes><class branch-rate="0.5" complexity="0.0" filename="good.cpp" line-rate="1.0" name="good1.cpp">
<lines>
<line branch="false" hits="96" number="8" condition-coverage="100%"/>
</lines>
</class></package>
</packages>