1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-18 05:43:10 +00:00
community.general/tests/integration/targets/xml/fixtures
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
..
ansible-xml-beers-unicode.xml
ansible-xml-beers-unicode.xml.license
ansible-xml-beers.xml
ansible-xml-beers.xml.license
ansible-xml-doctype.xml xml: preserve DOCTYPE declaration when writing XML files (#12148) 2026-06-13 17:10:25 +02:00
ansible-xml-doctype.xml.license xml: preserve DOCTYPE declaration when writing XML files (#12148) 2026-06-13 17:10:25 +02:00
ansible-xml-items.xml xml: fix predicated xpath no-match incorrectly creating nodes (#12031) 2026-05-17 10:48:56 +02:00
ansible-xml-items.xml.license xml: fix predicated xpath no-match incorrectly creating nodes (#12031) 2026-05-17 10:48:56 +02:00
ansible-xml-namespaced-beers.xml
ansible-xml-namespaced-beers.xml.license