xmllint未知选项'--xpath' [英] xmllint unknown option '--xpath'
问题描述
我已经在多个地方看到了这种语法(例如,此处 ):
I've seen this syntax several places (eg, here):
xmllint --xpath '/plist/array/string/text()' tmp.xml
,用于使用xpath选择器查询特定的XML节点.但是,当我尝试在我的计算机(mac os x snow leopard)上执行此错误时,出现错误Unknown option --xpath
.
xmllint --xpath '/plist/array/string/text()' tmp.xml
, used to query a particular XML node using an xpath selector. However, I'm getting the error Unknown option --xpath
when I try to execute this on my machine (mac os x snow leopard).
更仔细地查看xmllint的手册页,我没有看到--xpath
选项的文档...
Looking more closely at the man page for xmllint, I don't see the --xpath
option documented...
我在这里完全错过了什么吗?
Am I just totally missing something here?
推荐答案
xmllint --shell tmp.xml <<<'xpath /plist/array/string/text()'
如果您需要使xmllint读取stdin:
If you need to make xmllint to read stdin:
cat /tmp/tmp.xml | xmllint --shell <(cat) <<<'xpath /plist/array/string/text()'
这篇关于xmllint未知选项'--xpath'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!