xmlstarlet 1.3.0 is broken when handing entities, making it unusable on files with entities.
With the attached files:
$ xmlstarlet sel -t -c //test external-pe.xml
<test>&entity;</test>
$ xmlstarlet sel -t -v //test external-pe.xml
bar
$ xmlstarlet sel -t -c //foo external-pe.xml
zsh: exit 1 xmlstarlet sel -t -c //foo external-pe.xml
$ xmlstarlet sel -t -v //foo external-pe.xml
zsh: exit 1 xmlstarlet sel -t -v //foo external-pe.xml
$
Only the second command is correct.
Version 1.0.2-1 behaved correctly on all commands:
$ xmlstarlet sel -t -c //test external-pe.xml
<test>
<foo>bar</foo>
</test>
$ xmlstarlet sel -t -v //test external-pe.xml
bar
$ xmlstarlet sel -t -c //foo external-pe.xml
<foo>bar</foo>
$ xmlstarlet sel -t -v //foo external-pe.xml
bar
$
I've also reported this bug in the Debian BTS: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653666
testcase
I introduced this bug in 1.1.0 (5895befb8d2), when I moved to xmlReadFile instead of xmlParseFile.
Now fixed in a78969078883050584a4f10a873de7295c6c95d7
Fixed in release 1.3.1