Xmlstarlet: Difference between revisions

No edit summary
 
(One intermediate revision by the same user not shown)
Line 146: Line 146:


===Counting===
===Counting===
Count all nodes in a document:<code>xml sel -t -v "count(//node())"
* Count all nodes in a document:<code>xml sel -t -v "count(//node())"</code>
Count all occurrences of <tt>somenode</tt> nodes:<code>xml sel -t -v "count(//somenode)"</code>
* Count all occurrences of <tt>somenode</tt> nodes:<code>xml sel -t -v "count(//somenode)"</code>


==See Also==
==See Also==
* [http://xmlstar.sourceforge.net/doc/UG/index.html XmlStarlet reference]
* [http://xmlstar.sourceforge.net/doc/UG/index.html XmlStarlet reference]