Restore @id and dropped ISOSTS attributes on IsoSts models#42
Draft
HassanAkbar wants to merge 3 commits into
Draft
Restore @id and dropped ISOSTS attributes on IsoSts models#42HassanAkbar wants to merge 3 commits into
HassanAkbar wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Sts::IsoSts model layer to prevent silent data loss by restoring the conventional @id attribute on selected elements and adding missing ISOSTS-defined attributes/mappings (notably xlink:* and xml:lang fixes). It also includes spec updates to assert exact attribute sets and to guard against unmapped-but-declared attributes.
Changes:
- Restored conventional
@idsupport on additional IsoSts elements (includingxs:string-typed elements) and added/verified attribute mappings. - Restored previously dropped ISOSTS attributes across multiple IsoSts models (e.g.,
xlink:*,arrange,specific-use,content-type,alt,underline-style). - Corrected
xml:langmapping forstandard,sec, andterm-sec(and renamedIsoSts::Standard#langto#xml_lang), with expanded specs to cover round-trips and attribute sets.
Reviewed changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| TODO.sts-refactor/03-namespace-coupling.md | Updates ADR notes to clarify ISOSTS.xsd vs conventional @id authority and verification expectations. |
| TODO.sts-refactor/00-overview.md | Updates project overview notes to reflect restored ISOSTS attributes and the intentional conventional @id. |
| spec/iso_sts/iso_sts_element_spec.rb | Strengthens attribute-set assertions and adds round-trip tests for @id, xlink:type, and corrected xml:lang. |
| lib/sts/iso_sts/year.rb | Adds conventional @id attribute + XML mapping to year. |
| lib/sts/iso_sts/volume.rb | Adds conventional @id attribute + XML mapping to volume. |
| lib/sts/iso_sts/version.rb | Adds conventional @id attribute + XML mapping to version. |
| lib/sts/iso_sts/urn.rb | Adds conventional @id attribute + XML mapping to urn. |
| lib/sts/iso_sts/uri.rb | Adds missing xlink:type attribute + XML mapping to uri. |
| lib/sts/iso_sts/underline.rb | Adds missing underline-style attribute + XML mapping to underline. |
| lib/sts/iso_sts/title.rb | Adds missing content-type / specific-use attributes + XML mappings to title. |
| lib/sts/iso_sts/term_sec.rb | Fixes xml:lang mapping name (from lang to xml:lang) in term-sec. |
| lib/sts/iso_sts/suppl_version.rb | Adds conventional @id attribute + XML mapping to suppl-version. |
| lib/sts/iso_sts/suppl_type.rb | Adds conventional @id attribute + XML mapping to suppl-type. |
| lib/sts/iso_sts/suppl_number.rb | Adds conventional @id attribute + XML mapping to suppl-number. |
| lib/sts/iso_sts/sup.rb | Restores ISOSTS attributes (arrange, specific-use) and maps them for sup. |
| lib/sts/iso_sts/sub.rb | Restores ISOSTS attributes (arrange, specific-use) and maps them for sub. |
| lib/sts/iso_sts/standard.rb | Renames lang to xml_lang and fixes mapping to xml:lang for standard. |
| lib/sts/iso_sts/secretariat.rb | Adds conventional @id attribute + XML mapping to secretariat. |
| lib/sts/iso_sts/sec.rb | Fixes xml:lang mapping name (from lang to xml:lang) in sec. |
| lib/sts/iso_sts/sdo.rb | Adds conventional @id attribute + XML mapping to sdo. |
| lib/sts/iso_sts/release_version.rb | Adds conventional @id attribute + XML mapping to release-version. |
| lib/sts/iso_sts/pub_id.rb | Adds conventional @id attribute + XML mapping to pub-id. |
| lib/sts/iso_sts/pub_date.rb | Adds conventional @id attribute + XML mapping to pub-date. |
| lib/sts/iso_sts/proj_id.rb | Adds conventional @id attribute + XML mapping to proj-id. |
| lib/sts/iso_sts/part_number.rb | Adds conventional @id attribute + XML mapping to part-number. |
| lib/sts/iso_sts/page_range.rb | Adds conventional @id attribute + XML mapping to page-range. |
| lib/sts/iso_sts/originator.rb | Adds conventional @id attribute + XML mapping to originator. |
| lib/sts/iso_sts/named_content.rb | Adds missing xlink:type attribute + XML mapping to named-content. |
| lib/sts/iso_sts/mixed_citation.rb | Restores missing xlink:* attributes and maps them on mixed-citation. |
| lib/sts/iso_sts/lpage.rb | Adds conventional @id attribute + XML mapping to lpage. |
| lib/sts/iso_sts/label.rb | Restores missing alt and xml:lang attributes + XML mappings to label. |
| lib/sts/iso_sts/issue.rb | Adds conventional @id attribute + XML mapping to issue. |
| lib/sts/iso_sts/is_proof.rb | Adds conventional @id attribute + XML mapping to empty is-proof. |
| lib/sts/iso_sts/ics.rb | Adds conventional @id attribute + XML mapping to ics. |
| lib/sts/iso_sts/graphic.rb | Restores missing xlink:* and originator attributes + XML mappings to graphic. |
| lib/sts/iso_sts/fpage.rb | Adds conventional @id attribute + XML mapping to fpage. |
| lib/sts/iso_sts/ext_link.rb | Restores missing xlink:* attributes + XML mappings to ext-link. |
| lib/sts/iso_sts/edition.rb | Restores missing content-type / specific-use / xml:lang attributes + XML mappings to edition. |
| lib/sts/iso_sts/doc_type.rb | Adds conventional @id attribute + XML mapping to doc-type. |
| lib/sts/iso_sts/doc_number.rb | Adds conventional @id attribute + XML mapping to doc-number. |
| lib/sts/iso_sts/copyright_year.rb | Restores missing content-type / specific-use attributes + XML mappings to copyright-year. |
| lib/sts/iso_sts/copyright_statement.rb | Restores missing content-type / specific-use / xml:lang attributes + XML mappings to copyright-statement. |
| lib/sts/iso_sts/copyright_holder.rb | Restores missing content-type / specific-use / xml:lang attributes + XML mappings to copyright-holder. |
| lib/sts/iso_sts/body.rb | Restores missing specific-use attribute + XML mapping to body. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Metanorma PR checklist
Restores the
@idon 23 IsoSts element classes (the 86948b9 convention) and adds 39 ISOSTS attributes that 15 models silently dropped — real data loss, e.g.sub/suparrange+specific-use,ext-link/mixed-citation/uri/named-contentxlink:*,graphicxlink:*+originator,copyright-*,edition,title,label,underline,body. Also fixessec/standard/term-sec, which mapped ISOSTSxml:langunder the wrong XML name (lang), losing it on parse.Breaking change:
IsoSts::Standard#langis renamed to#xml_lang(to match itsSec/TermSecsiblings and correct thexml:langmapping). Callers usingstandard.langmust switch tostandard.xml_lang.Deferred to a follow-up: 7 spurious attributes on 5 models, and the 6 classes left without
@idin 86948b9.