1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-06 00:07:12 +00:00
community.general/tests/integration/targets/xml/tasks
Alexei Znamensky 15616be827
xml: fix predicated xpath no-match incorrectly creating nodes (#12031)
* fix(xml): no-op when predicated xpath finds no match instead of creating nodes

When using xpath like element[text()='old'] with value=new, a no-match due
to the predicate not being satisfied incorrectly triggered node creation,
corrupting the XML. Now treats predicate misses as a no-op.

Fixes #8730

* changelog(xml): add fragment for PR #12031

* fix(xml): remove spurious test-unset-element-value include from main.yml

That file belongs to a different branch and was accidentally dragged in
during a stash conflict resolution.

* feat(xml): add create_if_missing option to control node creation on value no-match

Instead of implicitly creating nodes when value is set and xpath finds no match,
expose create_if_missing (default true, preserving old behavior) so callers
can opt into a silent no-op with create_if_missing=false.

Fixes #8730
2026-05-17 10:48:56 +02:00
..
main.yml xml: fix predicated xpath no-match incorrectly creating nodes (#12031) 2026-05-17 10:48:56 +02:00
test-add-children-elements-unicode.yml
test-add-children-elements.yml
test-add-children-from-groupvars.yml
test-add-children-insertafter.yml
test-add-children-insertbefore.yml
test-add-children-with-attributes-unicode.yml
test-add-children-with-attributes.yml
test-add-element-implicitly.yml
test-add-namespaced-children-elements.yml
test-children-elements-xml.yml
test-count-unicode.yml
test-count.yml
test-get-element-content-unicode.yml
test-get-element-content.yml
test-mutually-exclusive-attributes.yml
test-pretty-print-only.yml
test-pretty-print.yml
test-print-match.yml xml: fix print_match not populating matches return value (#12013) 2026-05-10 11:41:37 +12:00
test-remove-attribute-nochange.yml
test-remove-attribute.yml
test-remove-element-nochange.yml
test-remove-element.yml
test-remove-namespaced-attribute-nochange.yml
test-remove-namespaced-attribute.yml
test-remove-namespaced-element-nochange.yml
test-remove-namespaced-element.yml
test-set-attribute-value-boolean.yml xml: fail for non-string values (#11959) 2026-05-06 19:23:58 +02:00
test-set-attribute-value-unicode.yml
test-set-attribute-value.yml
test-set-children-elements-level.yml
test-set-children-elements-unicode.yml
test-set-children-elements-value.yml
test-set-children-elements.yml
test-set-element-value-empty.yml
test-set-element-value-predicate.yml xml: fix predicated xpath no-match incorrectly creating nodes (#12031) 2026-05-17 10:48:56 +02:00
test-set-element-value-unicode.yml
test-set-element-value.yml
test-set-namespaced-attribute-value.yml
test-set-namespaced-children-elements.yml
test-set-namespaced-element-value.yml
test-xmlstring.yml