1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-14 11:57:40 +00:00
community.general/tests/integration/targets/xml/results
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
..
test-add-children-elements-unicode.xml
test-add-children-elements-unicode.xml.license
test-add-children-elements.xml
test-add-children-elements.xml.license
test-add-children-from-groupvars.xml
test-add-children-from-groupvars.xml.license
test-add-children-insertafter.xml
test-add-children-insertafter.xml.license
test-add-children-insertbefore.xml
test-add-children-insertbefore.xml.license
test-add-children-with-attributes-unicode.xml
test-add-children-with-attributes-unicode.xml.license
test-add-children-with-attributes.xml
test-add-children-with-attributes.xml.license
test-add-element-implicitly.xml
test-add-element-implicitly.xml.license
test-add-namespaced-children-elements.xml
test-add-namespaced-children-elements.xml.license
test-preserve-doctype.xml [PR #12148/5004c9f7 backport][stable-13] xml: preserve DOCTYPE declaration when writing XML files (#12249) 2026-06-13 17:33:15 +02:00
test-preserve-doctype.xml.license [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.xml
test-pretty-print-only.xml.license
test-pretty-print.xml
test-pretty-print.xml.license
test-remove-attribute.xml
test-remove-attribute.xml.license
test-remove-element.xml
test-remove-element.xml.license
test-remove-namespaced-attribute.xml
test-remove-namespaced-attribute.xml.license
test-remove-namespaced-element.xml
test-remove-namespaced-element.xml.license
test-set-attribute-value-unicode.xml
test-set-attribute-value-unicode.xml.license
test-set-attribute-value.xml
test-set-attribute-value.xml.license
test-set-children-elements-empty-list.xml
test-set-children-elements-empty-list.xml.license
test-set-children-elements-level.xml
test-set-children-elements-level.xml.license
test-set-children-elements-unicode.xml
test-set-children-elements-unicode.xml.license
test-set-children-elements-value.xml
test-set-children-elements-value.xml.license
test-set-children-elements.xml
test-set-children-elements.xml.license
test-set-element-value-empty.xml
test-set-element-value-empty.xml.license
test-set-element-value-predicate.xml
test-set-element-value-predicate.xml.license
test-set-element-value-unicode.xml
test-set-element-value-unicode.xml.license
test-set-element-value.xml
test-set-element-value.xml.license
test-set-namespaced-attribute-value.xml
test-set-namespaced-attribute-value.xml.license
test-set-namespaced-element-value.xml
test-set-namespaced-element-value.xml.license