1

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

输出:

href="http://some.address"

如何只输出没有属性名称的链接?

4

1 回答 1

2

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

于 2012-04-16T08:59:56.353 回答