With the following file.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config>
<index type="I8">
<book>2</book>
</index>
</config>
I can't select book with
xmlstarlet sel --template --match /config/index[@type="I8"] -c . file.xml
I can't select book with
xmlstarlet sel --template --match /config/index[@type='I8'] -c . file.xml
I can select book with
xmlstarlet sel --template --match "/config/index[@type='I8']" -c . file.xml
I can select book with
xmlstarlet sel --template --match '/config/index[@type="I8"]' -c . file.xml
Also if type is type="8" in xml, I can select it with:
xmlstarlet sel --template --match /config/index[@type="8"] -c . file.xml
Why?
xmlstarlet 1.6.1
compiled against libxml2 2.9.4, linked with 20904
compiled against libxslt 1.1.29, linked with 10129
/config/index[@type=string("I8")]
or/config/index[string(@type)="I8"]
or/config/index[normalize-space(@type)="I8"]
? – E.Wiest'xmlstarlet sel --template --match /config/index[@type=string("I8")] -c . file.xml'
– E.Wiest