I need set query to the dom4j document like Node fromTag = document.selectSingleNode("//*:from"); without prefix in select query. How can I do that?

有帮助吗?

解决方案

DOM4J supports XPath 1.0 only, but you can use this expression instead:

document.selectSingleNode("//*[local-name()='from']");
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top