Mantis - xmlstarlet
Viewing Issue Advanced Details
4645 regular use feature always 2010-12-21 18:51 2011-06-15 14:18
skayser  
dam  
normal  
closed  
fixed  
none    
none  
0004645: Return code in select mode could indicate whether query matches or not
I am trying to use xmlstarlet to test whether XML documents contain certain elements. Here it would be very helpful, if xmlstarlet could indicate via its return code whether or not matching elements were found (just like e.g. grep does). Currently, the return code is always 0 in either case.

$ cat test.xml
<test>
    <item name="foo">bar</item>
</test>

$ xmlstarlet sel -t -c "//item[@name='foo']" test.xml
<item name="foo">bar</item>
$ echo $?
0

$ xmlstarlet sel -t -c "//item[@name='foo-nomatch']" test.xml
$ echo $?
0
$ pkgparam CSWxmlstarlet VERSION
1.0.2,REV=2010.04.17
Issue History
2010-12-21 18:51 skayser New Issue
2011-01-11 17:02 dam Status new => assigned
2011-01-11 17:02 dam Assigned To => dam
2011-01-11 17:02 dam Note Added: 0008698
2011-01-11 17:02 dam Status assigned => feedback
2011-01-11 18:24 skayser Note Added: 0008700
2011-05-30 19:33 skayser Note Added: 0009093
2011-06-15 14:18 dam Note Added: 0009119
2011-06-15 14:18 dam Status feedback => closed
2011-06-15 14:18 dam Resolution open => fixed

Notes
(0008698)
dam   
2011-01-11 17:02   
Please report errors only concerning upstream at the SF website:
  https://sourceforge.net/tracker/?group_id=66612&atid=515106 [^]
xmlstarlet now has more upstream developers working on functional fixes.
(0008700)
skayser   
2011-01-11 18:24   
Filed this bug as an upstream feature request. https://sourceforge.net/tracker/?func=detail&aid=3155702&group_id=66612&atid=515109 [^]
(0009093)
skayser   
2011-05-30 19:33   
Feature has been integrated by upstream and thus should be available with the next release.

http://sourceforge.net/tracker/?func=detail&aid=3155702&group_id=66612&atid=515109#artifact_comment_5181486 [^]
(0009119)
dam   
2011-06-15 14:18   
Fixed in 1.2.0,REV=2011.06.01 and released to current/.