问题描述
<?xml version="1.0"?>
<music>
<style type="rock">
<band id="1">
<name>Led Zeppelin</name>
<genre>Hard Rock</genre>
<cast>
<artist type="vocal">Robert Plant</artist>
<artist type="drums">John Bonham</artist>
<artist type="bass">John Paul Jones</artist>
<artist type="guitar">Jimmy Page</artist>
</cast>
</band>
<band id="2">
<name>Scorpions</name>
<genre>Heavy Metal</genre>
<cast>
<artist type="rhythm guitar">Rudolf Schenker</artist>
<artist type="lead guitar">Matthias Jabs</artist>
<artist type="bass">Pawel Maciwoda</artist>
</cast>
</band>
</style>
</music>
List<Node> nodes = document.selectNodes("/music/style/band[genge[text()='Hard Rock']]/name");
nodes.stream().map(n -> n.getStringValue()).forEach(System.out::println);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)