I stumbled on the same issue when playing with Maven pom files and it
seems to be a feature of xmlstarlet:

   http://xmlstar.sourceforge.net/doc/UG/ch05s01.html

If the document has a default namespace it has to be specified
explicitly with the -N option and then prefixed to the name of the
elements in the XPath expression:

xmlstarlet sel -N xhtml=http://www.w3.org/1999/xhtml -T -t -c
'//xhtml:h3[@id="baz"]' -n test2.xml

This is rather annoying and the default namespace should probably be
ignored, but at least there is a workaround.

Emmanuel Bourg

Reply via email to