1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-14 20:07:38 +00:00
community.general/tests/integration/targets/xml/tasks
patchback[bot] 3bc92d03c4
[PR #12148/5004c9f7 backport][stable-13] xml: preserve DOCTYPE declaration when writing XML files (#12249)
xml: preserve DOCTYPE declaration when writing XML files (#12148)

* fix(xml): preserve DOCTYPE declaration when writing XML files

Pass `doctype=tree.docinfo.doctype` to all `ElementTree.write()` calls
so lxml does not silently drop the DOCTYPE on serialization. Also replace
`etree.tostring()` with BytesIO+write() in the diff and xmlstring paths
for consistency.

Fixes #2762



* test(xml): add integration test for DOCTYPE preservation



* feat(changelog): add fragment for xml DOCTYPE fix (#12148)



---------


(cherry picked from commit 5004c9f70f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 17:33:15 +02:00
..
main.yml [PR #12148/5004c9f7 backport][stable-13] xml: preserve DOCTYPE declaration when writing XML files (#12249) 2026-06-13 17:33:15 +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-preserve-doctype.yml [PR #12148/5004c9f7 backport][stable-13] xml: preserve DOCTYPE declaration when writing XML files (#12249) 2026-06-13 17:33:15 +02:00
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