Why doesn't xmlstarlet select all nodes?

我只是一个虾纸丫 提交于 2019-11-29 15:04:14

Is this what you need?

xml sel -t -m "//@category" -v "." -o " " books.xml

or to separate the results on each line

xml sel -t -m "//@category" -v "." -n books.xml

Update

You're right, your XPath was good, you just need different parameters.

Regarding why the original doesn't work: XSLT 1.0 value-of is defined to work like XPath's string() function, and string(node-set) => string(first-node). See also Feature Request: value-of multiple nodes should concat values of all nodes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!