Skip to content

Fix XmlDocument.getDocumentBuilder to preserve XML comments on parse - #557

Merged
venmanyarun merged 1 commit into
OpenLiberty:1.xfrom
venmanyarun:fix/GH-xmldocument-preserve-comments-on-parse
Oct 8, 2026
Merged

venmanyarun merged 1 commit into
OpenLiberty:1.xfrom
venmanyarun:fix/GH-xmldocument-preserve-comments-on-parse

Conversation

@venmanyarun

Copy link
Copy Markdown
Member

Commit 28cfab5 refactored createDocument(File) to use the shared getDocumentBuilder() factory which had setIgnoringComments(true). This caused XML comments (e.g. ) to be stripped from server.xml when it was parsed and written back during generate-features, breaking the generate-features integration tests.

Set setIgnoringComments(false) in getDocumentBuilder() to restore the original behaviour of preserving comments during document parse/write.

Commit 28cfab5 refactored createDocument(File) to use the shared
getDocumentBuilder() factory which had setIgnoringComments(true).
This caused XML comments (e.g. <!--replaceable-->) to be stripped
from server.xml when it was parsed and written back during
generate-features, breaking the generate-features integration tests.

Set setIgnoringComments(false) in getDocumentBuilder() to restore the
original behaviour of preserving comments during document parse/write.
@venmanyarun
venmanyarun merged commit 9e2a857 into OpenLiberty:1.x Oct 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant