怎么是用xpath获取标签的属性值?

2025-04-25 20:21:24
推荐回答(2个)
回答1:

Element root = document.getRootElement();
Element node = root.selectSingleNode("/chart/dials/dial[tt='92']");
String value = node.getAttributeValue("tt");

回答2:

//img/@src