1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-18 22:03:04 +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
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 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
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