1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-07-01 16:18:55 +00:00
community.general/tests/integration/targets/xml/results
Alexei Znamensky 5004c9f70f
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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 17:10:25 +02:00
..
test-add-children-elements-unicode.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-add-children-elements-unicode.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-add-children-elements.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-add-children-elements.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-add-children-from-groupvars.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-add-children-from-groupvars.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-add-children-insertafter.xml Initial commit 2020-03-09 09:11:07 +00:00
test-add-children-insertafter.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-add-children-insertbefore.xml Initial commit 2020-03-09 09:11:07 +00:00
test-add-children-insertbefore.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-add-children-with-attributes-unicode.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-add-children-with-attributes-unicode.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-add-children-with-attributes.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-add-children-with-attributes.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-add-element-implicitly.xml Add default license header to files which have no copyright or license header yet (#5074) 2022-08-05 14:03:38 +02:00
test-add-element-implicitly.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-add-namespaced-children-elements.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-add-namespaced-children-elements.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-preserve-doctype.xml xml: preserve DOCTYPE declaration when writing XML files (#12148) 2026-06-13 17:10:25 +02:00
test-preserve-doctype.xml.license xml: preserve DOCTYPE declaration when writing XML files (#12148) 2026-06-13 17:10:25 +02:00
test-pretty-print-only.xml Initial commit 2020-03-09 09:11:07 +00:00
test-pretty-print-only.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-pretty-print.xml Initial commit 2020-03-09 09:11:07 +00:00
test-pretty-print.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-remove-attribute.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-remove-attribute.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-remove-element.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-remove-element.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-remove-namespaced-attribute.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-remove-namespaced-attribute.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-remove-namespaced-element.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-remove-namespaced-element.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-attribute-value-unicode.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-attribute-value-unicode.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-attribute-value.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-attribute-value.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-children-elements-empty-list.xml xml children module parameter does not exist (#5808) 2023-01-14 18:22:00 +01:00
test-set-children-elements-empty-list.xml.license xml children module parameter does not exist (#5808) 2023-01-14 18:22:00 +01:00
test-set-children-elements-level.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-children-elements-level.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-children-elements-unicode.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-children-elements-unicode.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-children-elements-value.xml add special word '+value' to add_children/set_children in xml module (#8437) 2025-05-31 16:42:24 +02:00
test-set-children-elements-value.xml.license add special word '+value' to add_children/set_children in xml module (#8437) 2025-05-31 16:42:24 +02:00
test-set-children-elements.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-children-elements.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-element-value-empty.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-element-value-empty.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-element-value-predicate.xml xml: fix predicated xpath no-match incorrectly creating nodes (#12031) 2026-05-17 10:48:56 +02:00
test-set-element-value-predicate.xml.license xml: fix predicated xpath no-match incorrectly creating nodes (#12031) 2026-05-17 10:48:56 +02:00
test-set-element-value-unicode.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-element-value-unicode.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-element-value.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-element-value.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-namespaced-attribute-value.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-namespaced-attribute-value.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00
test-set-namespaced-element-value.xml Make sure all files have trailing newline (#5076) 2022-08-05 21:08:41 +02:00
test-set-namespaced-element-value.xml.license Add more default license and copyright notices (#5087) 2022-08-08 08:44:19 +02:00