标签: java xpath-2.0 dom4j
我需要像dom4j文件一样设置查询 Node fromTag = document.selectSingleNode("//*:from"); 在select查询中没有前缀。我怎么能这样做?
Node fromTag = document.selectSingleNode("//*:from");
答案 0 :(得分:0)
DOM4J仅支持XPath 1.0,但您可以使用此表达式:
document.selectSingleNode("//*[local-name()='from']");