xmlpoke with failonerror=true does not fail when xpath matches zero nodes #44

Closed
scalder opened this Issue May 8, 2012 · 3 comments

Projects

None yet

2 participants

@scalder
Contributor
scalder commented May 8, 2012

The behaviour between xmlpeek and xmlpoke is different, with regards to the xpath node matches. In both cases, if failonerror=false, a Warning is logged and processing continues (expected behaviour). Likewise, with failonerror=true, if there are zero nodes found with the xpath match in xmlpeek, it fails processing (also expected behaviour). Intuitively I would expect xmlpoke to also fail if zero nodes are matched and failonerror=true... however it does not. Instead it just does the same behaviour as when failonerror=false.

Arguable whether this is a bug or a "feature" now that it has existed like this for so long. Personally I'd call it a bug. I plan to submit a patch that corrects the behaviour of xmlpoke when failonerror=true and zero nodes are matched by the xpath... and if people want xmlpoke to continue with it's current behaviour they can always just set failonerror=false.

@scalder
Contributor
scalder commented May 8, 2012

Pull request containing the fix: #45

@scalder
Contributor
scalder commented May 9, 2012

Pull request containing the fix, without additional formatting changes: #46

@rmboggs
Member
rmboggs commented May 14, 2012

Pull request #46 has been pulled to master. Thanks.

@rmboggs rmboggs closed this May 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment