[bug-notifications] [xmlstarlet 0004645]: Return code in select mode could indicate whether query matches or not
Mantis Bug Tracker
noreply at opencsw.org
Tue Jan 11 17:02:42 CET 2011
The following issue requires your FEEDBACK.
======================================================================
https://www.opencsw.org/mantis/view.php?id=4645
======================================================================
Reported By: skayser
Assigned To: dam
======================================================================
Project: xmlstarlet
Issue ID: 4645
Category: regular use
Reproducibility: always
Severity: feature
Priority: normal
Status: feedback
======================================================================
Date Submitted: 2010-12-21 18:51 CET
Last Modified: 2011-01-11 17:02 CET
======================================================================
Summary: Return code in select mode could indicate whether
query matches or not
Description:
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
======================================================================
----------------------------------------------------------------------
(0008698) dam (administrator) - 2011-01-11 17:02
https://www.opencsw.org/mantis/view.php?id=4645#c8698
----------------------------------------------------------------------
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.
More information about the bug-notifications
mailing list