lxcount — Count elements in an XML document


lxcount [ -xmlns[:prefix]=uri ...] [ -q query ] [ input-file ]


lxcount counts the elements in a document. By default, it prints the number of occurrences of each element name, and the total number of elements. The -q option restricts the count to elements matching the specified XPath.

The input-file argument may be a URI instead of a filename. If no input-file argument is given, standard input is used.


binds a prefix (or the default namespace) to a URI for use in XPath queries.

-q query

an XPath query identifying the elements to be counted. This query is streamed.