示例.xml:
` id 1 的 lvl3 测试点 id 1 的 lvl4
<tester>
<level1 id="2"> test point </level1>
<level2> </level2>
<level3>lvl3 of id 2 </level3>
<level4> lvl4 of id 2</level4>
<level5> </level5>
</tester>
<tester>
<level1 id="3"> test point </level1>
<level2> </level2>
<level3>lvl3 of id 3</level3>
<level4>lvl4 of id 3</level4>
<level5> </level5>
</tester>
<tester>
<level1 id="2"> test point </level1>
<level2> </level2>
<level3>lvl3 of id 2 2nd occurance</level3>
<level4>lvl4 of id 2 2nd occurance</level4>
<level5> </level5>
</tester>
`对于上面提到的sample.xml,只有在level1 中的Id为2
时,我才需要获取level3 和level4 标记。例如:当我搜索id=2时,我应该得到以下答案
<level3>lvl3 of id 2 </level3>
<level4> lvl4 of id 2</level4>
<level3>lvl3 of id 2 2nd occurance</level3>
<level4>lvl4 of id 2 2nd occurance</level4>