1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-27 22:49:14 +00:00
community.general/tests/integration/targets/xml
patchback[bot] b4e3d32e5a
[PR #12148/5004c9f7 backport][stable-12] xml: preserve DOCTYPE declaration when writing XML files (#12248)
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:13 +02:00
..
fixtures [PR #12148/5004c9f7 backport][stable-12] xml: preserve DOCTYPE declaration when writing XML files (#12248) 2026-06-13 17:33:13 +02:00
meta Add default license header to files which have no copyright or license header yet (#5074) 2022-08-05 14:03:38 +02:00
results [PR #12148/5004c9f7 backport][stable-12] xml: preserve DOCTYPE declaration when writing XML files (#12248) 2026-06-13 17:33:13 +02:00
tasks [PR #12148/5004c9f7 backport][stable-12] xml: preserve DOCTYPE declaration when writing XML files (#12248) 2026-06-13 17:33:13 +02:00
vars Adjust YAML files (#10233) 2025-06-15 09:13:16 +02:00
aliases [PR #11660/b1ac989c backport][stable-12] remove skip/aix from aliases files (#11661) 2026-03-23 07:04:20 +01:00