Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
xmlpoke with failonerror=true does not fail when xpath matches zero nodes #44
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.