fix: true booleans incorrectly rendered as "1" in XML output#1200
Open
gennaroprota wants to merge 1 commit into
Open
Conversation
✨ Highlights
🧾 Changes by Scope
🔝 Top Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1200 +/- ##
========================================
Coverage 82.12% 82.12%
========================================
Files 33 33
Lines 3149 3149
Branches 734 734
========================================
Hits 2586 2586
Misses 387 387
Partials 176 176
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
An automated preview of the documentation is available at https://1200.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-05-13 14:29:06 UTC |
The XML writer emitted true boolean members as `<x>1</x>` (and omitted the element when false). Reading such output meant knowing that the member was actually a boolean. The writer now emits the xsd:boolean primary lexical form, `<x>true</x>`. The omit-when-false convention is preserved, so the golden XMLs change only in the body of already-present boolean elements. The RELAX NG schema is updated accordingly.
b2c63a4 to
55bca26
Compare
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.
The XML writer emitted true boolean members as
<x>1</x>(and omitted the element when false). Reading such output meant knowing that the member was actually a boolean.The writer now emits the xsd:boolean primary lexical form,
<x>true</x>. The omit-when-false convention is preserved, so the golden XMLs change only in the body of already-present boolean elements. The RELAX NG schema is updated accordingly.Summary
Fixes a long-standing readability quirk in the XML output. The XML writer emitted true boolean members as
<x>1</x>(and omitted the element when false). Reading such output meant the consumer had to know in advance that the member was actually a boolean —1looks indistinguishable from an integer.The writer now emits the
xsd:booleanprimary lexical form:<x>true</x>. The omit-when-false convention is preserved, so the golden XML fixtures change only in the body of already-present boolean elements. The RELAX NG schema is updated to match.Changes
src/lib/Gen/xml/XMLWriter.cpp— the boolean-serialization branch now writes"true"instead of"1".test-files/golden-tests/updated to reflect the new<x>true</x>form. Intentional output corrections, not regenerations.mrdocs.rncupdated so the schema accepts the new lexical form on boolean elements."1"will need to update to handle"true". The omit-when-false convention is unchanged, so handling for absent elements is unaffected.Testing
"1"for booleans (or omits an element when true) fails the golden tests.test-files/golden-tests/on every build, so the new expectations stay enforced going forward.Documentation
The schema (
mrdocs.rnc) is the canonical reference for the XML output format and is updated. No prose documentation describes the previous"1"encoding, so nothing else needs updating.