I am using xmllint's interactive shell on cygwin. I would like to count the number of nodes, but xmllint doesn't seem to behaving as I expect:
$> cat test.xml <?xml version="1.0"?> <result> <node> <item/> <item/> <item/> <item/> <item/> </node> </result> $> xmllint --shell test.xml / > cat count(/result/node/item) count(/result/node/item) is a number
It says it's a number, but it doesn't show the number in a manner I've seen from web searches:
count(/result/node/item) is a number : 5
What is going wrong here?
$> xmllint --version xmllint: using libxml version 20706 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib