Repository navigation
fix(spec): move XML declaration before the leading comment in fixture - #8
Merged
Merged
Conversation
The antcc MAG8000 fixture began with a provenance comment followed by the XML declaration. A comment before the XML declaration is not well-formed: the declaration must be the very first thing in the document. Modern strict parsing rejects or degrades such input; with the Nokogiri adapter this specific misplacement caused '>' character references in the document body to be dropped during parsing, so the round-trip comparison failed on missing '>' characters in XHTML-CONTENT text. Reorder the prolog so the declaration is line 1 and the comment follows it (a legal prolog comment). No document content changes.
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.
Problem
The dependent-gems CI run against lutaml-model main reported 1 failure out of 30 examples:
spec/reqif_spec.rb[1:1:8:1], the round-trip comparison for theantcc_MAG8000-LTE-FeatureSpecReqBL4.reqiffixture (Canon reported>characters missing from XHTML-CONTENT text, e.g.device -> ...).Root cause
The fixture is not well-formed: it starts with a provenance comment (
<!-- FROM: ... -->) before the XML declaration. Per the XML spec, the declaration must be the very first thing in the document.When the Nokogiri adapter parses this input, the misplacement causes
>character references in the document body to be silently dropped (a minimal prolog reproducer confirms: a comment preceding<?xml?>makes Nokogiri drop>entities from text; the same document with the comment after the declaration parses fine). lutaml-model's reqif round trip therefore loses the>characters and the Canon comparison fails.Not a lutaml-model regression: the failure reproduces identically against released lutaml-model 0.8.59 and main (d978d533); the fixture predates this.
Fix
One-line fixture repair: move
<?xml version="1.0" encoding="UTF-8"?>to line 1 and let the provenance comment follow it (a legal prolog comment). No document content changes.Full suite: 31 examples, 0 failures (the +1 example vs CI is not part of this change).