turlife
turlife

Reputation: 121

How can I use xpath 2.0 in query to dom4j object in java

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

Upvotes: 0

Views: 645

Answers (1)

forty-two
forty-two

Reputation: 12817

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

document.selectSingleNode("//*[local-name()='from']");

Upvotes: 1

Related Questions