theta
theta

Reputation: 25601

Extract just the link from "a href"

xmllint sample.xml --xpath "//a[text()='some value']/@href"

outputs:

href="http://some.address"

How can I output just the link without attribute name?

Upvotes: 1

Views: 1762

Answers (1)

theta
theta

Reputation: 25601

xmllint sample.xml --xpath "string(//a[text()='some value']/@href)"

Upvotes: 2

Related Questions