[fix] remove omit-original-xml-declaration flag#6277
Draft
line-o wants to merge 1 commit into
Draft
Conversation
The custom serialization flag omit-original-xaml-declaration is removed. The only flag that controls if the xml declaration is present when serializing a document is the standard omit-xml-declaration. If a document has a stored declaration in the database then it will be used. If there is none then the xml declaration is being created. The only remaining issue is how to handle stored declarations in backups.
reinhapa
requested changes
Apr 30, 2026
Comment on lines
121
to
+122
| if (doc.getXmlDeclaration() != null){ | ||
| if ("no".equals(getProperty(EXistOutputKeys.OMIT_ORIGINAL_XML_DECLARATION, "no"))) { | ||
| if ("no".equals(getProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"))) { |
Member
There was a problem hiding this comment.
Join this if statements as suggested by Codacy
Contributor
|
test failures |
Member
Author
|
@duncdrum yes this is expected until we come to a solution for this issue
I should have marked this as a draft perhaps. |
Member
Author
|
The consensus when discusssing this topic on the community call on 18th May was to
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The custom serialization flag
omit-original-xml-declarationis removed. The only flag that controls if the xml declaration is present or not when serializing a document is the standardomit-xml-declaration.If a document has a stored declaration in the database then it will be used. If there is none then the xml declaration is being created.
The only remaining issue is how to handle stored declarations in backups. They should be part of the backup if - and only if - there is one stored.
---- IMPORTANT ----
This PR was opened to start the discussion. I will add it to the agenda of next weeks community call.
So why is this an issue in the first place?
The newly added, custom serialization flag has precedence over the the standard flag that should control if an XML declaration is part of the output or not. This change in behaviour broke tests in node-exist and xst which is how I learned about it in the first place. I suspect that this feature might not even be documented yet.
I believe this extra flag does not need to be exposed. To discuss this, is the reason why I created this PR.
Reference:
added with 855922a
Type of tests:
none added so far