sts 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +17 -3
- data/CLAUDE.md +72 -0
- data/GAPS.guidelines.iso-sts-ed2.1/01-maintenance.md +19 -0
- data/GAPS.guidelines.iso-sts-ed2.1/03-general.md +75 -0
- data/GAPS.guidelines.iso-sts-ed2.1/04-structure.md +75 -0
- data/GAPS.guidelines.iso-sts-ed2.1/05-content.md +63 -0
- data/GAPS.guidelines.iso-sts-ed2.1/06-tables.md +53 -0
- data/GAPS.guidelines.iso-sts-ed2.1/07-formulae.md +41 -0
- data/GAPS.guidelines.iso-sts-ed2.1/08-figures.md +45 -0
- data/GAPS.guidelines.iso-sts-ed2.1/09-terms.md +56 -0
- data/GAPS.guidelines.iso-sts-ed2.1/10-references.md +56 -0
- data/GAPS.guidelines.iso-sts-ed2.1/annex-a-multilingual.md +79 -0
- data/GAPS.guidelines.niso-sts-v1.0/01-introduction-scope.md +27 -0
- data/GAPS.guidelines.niso-sts-v1.0/02-document-structure.md +100 -0
- data/GAPS.guidelines.niso-sts-v1.0/03-front-matter.md +149 -0
- data/GAPS.guidelines.niso-sts-v1.0/04-body-content.md +209 -0
- data/GAPS.guidelines.niso-sts-v1.0/05-tables-figures.md +152 -0
- data/GAPS.guidelines.niso-sts-v1.0/06-math-formulae.md +128 -0
- data/GAPS.guidelines.niso-sts-v1.0/07-references.md +113 -0
- data/GAPS.guidelines.niso-sts-v1.0/08-terminology.md +127 -0
- data/GAPS.guidelines.niso-sts-v1.0/09-metadata.md +113 -0
- data/GAPS.guidelines.niso-sts-v1.0/10-iso-iec-variant.md +141 -0
- data/GAPS.guidelines.niso-sts-v1.0/SUMMARY.md +96 -0
- data/GAPS.guidelines.schema-xref.md +101 -0
- data/Gemfile +2 -1
- data/TODO.sts-refactor/00-overview.md +172 -0
- data/TODO.sts-refactor/01-mathml-delegation.md +153 -0
- data/TODO.sts-refactor/02-type-resolution.md +122 -0
- data/TODO.sts-refactor/03-namespace-coupling.md +158 -0
- data/TODO.sts-refactor/04-register-versioning.md +180 -0
- data/TODO.sts-refactor/05-missing-elements.md +195 -0
- data/TODO.sts-refactor/06-missing-attributes.md +152 -0
- data/TODO.sts-refactor/07-incomplete-models.md +180 -0
- data/TODO.sts-refactor/08-isoiec-profile.md +169 -0
- data/TODO.sts-refactor/09-autoload-cleanup.md +88 -0
- data/TODO.sts-refactor/10-test-coverage.md +164 -0
- data/TODO.sts-refactor/11-duplicate-models.md +168 -0
- data/lib/sts/iso_sts/annex_type.rb +2 -0
- data/lib/sts/iso_sts/app.rb +26 -1
- data/lib/sts/iso_sts/app_group.rb +1 -0
- data/lib/sts/iso_sts/array.rb +1 -0
- data/lib/sts/iso_sts/back.rb +1 -0
- data/lib/sts/iso_sts/body.rb +4 -0
- data/lib/sts/iso_sts/bold.rb +23 -11
- data/lib/sts/iso_sts/break.rb +3 -0
- data/lib/sts/iso_sts/caption.rb +1 -0
- data/lib/sts/iso_sts/comm_ref.rb +2 -0
- data/lib/sts/iso_sts/content_language.rb +22 -0
- data/lib/sts/iso_sts/copyright_holder.rb +4 -2
- data/lib/sts/iso_sts/copyright_statement.rb +4 -2
- data/lib/sts/iso_sts/copyright_year.rb +3 -0
- data/lib/sts/iso_sts/def.rb +1 -0
- data/lib/sts/iso_sts/def_item.rb +1 -0
- data/lib/sts/iso_sts/def_list.rb +1 -0
- data/lib/sts/iso_sts/disp_formula.rb +5 -1
- data/lib/sts/iso_sts/doc_ref.rb +2 -0
- data/lib/sts/iso_sts/document_identification.rb +3 -0
- data/lib/sts/iso_sts/edition.rb +2 -0
- data/lib/sts/iso_sts/ext_link.rb +1 -1
- data/lib/sts/iso_sts/fig.rb +1 -0
- data/lib/sts/iso_sts/fn.rb +1 -0
- data/lib/sts/iso_sts/fn_group.rb +1 -0
- data/lib/sts/iso_sts/front.rb +5 -0
- data/lib/sts/iso_sts/graphic.rb +5 -0
- data/lib/sts/iso_sts/inline_formula.rb +1 -1
- data/lib/sts/iso_sts/iso_meta.rb +4 -3
- data/lib/sts/iso_sts/italic.rb +23 -11
- data/lib/sts/iso_sts/label.rb +7 -5
- data/lib/sts/iso_sts/language.rb +2 -0
- data/lib/sts/iso_sts/list.rb +1 -0
- data/lib/sts/iso_sts/list_item.rb +7 -4
- data/lib/sts/iso_sts/mathml2/math.rb +20 -18
- data/lib/sts/iso_sts/meta_date.rb +20 -0
- data/lib/sts/iso_sts/mixed_citation.rb +35 -11
- data/lib/sts/iso_sts/monospace.rb +26 -0
- data/lib/sts/iso_sts/named_content.rb +44 -0
- data/lib/sts/iso_sts/nat_meta.rb +5 -4
- data/lib/sts/iso_sts/non_normative_example.rb +5 -0
- data/lib/sts/iso_sts/non_normative_note.rb +1 -0
- data/lib/sts/iso_sts/page_count.rb +2 -0
- data/lib/sts/iso_sts/paragraph.rb +34 -22
- data/lib/sts/iso_sts/permissions.rb +3 -0
- data/lib/sts/iso_sts/preformat.rb +8 -5
- data/lib/sts/iso_sts/ref.rb +1 -0
- data/lib/sts/iso_sts/ref_list.rb +1 -0
- data/lib/sts/iso_sts/reg_meta.rb +5 -4
- data/lib/sts/iso_sts/release_date.rb +2 -0
- data/lib/sts/iso_sts/sc.rb +26 -0
- data/lib/sts/iso_sts/sec.rb +12 -2
- data/lib/sts/iso_sts/secretariat.rb +2 -0
- data/lib/sts/iso_sts/standard.rb +6 -0
- data/lib/sts/iso_sts/standard_cross_reference.rb +5 -2
- data/lib/sts/iso_sts/standard_identification.rb +3 -0
- data/lib/sts/iso_sts/standard_ref.rb +16 -0
- data/lib/sts/iso_sts/std.rb +7 -5
- data/lib/sts/iso_sts/std_ref.rb +2 -0
- data/lib/sts/iso_sts/strike.rb +26 -0
- data/lib/sts/iso_sts/styled_content.rb +19 -15
- data/lib/sts/iso_sts/sub.rb +2 -0
- data/lib/sts/iso_sts/sup.rb +2 -0
- data/lib/sts/iso_sts/table.rb +1 -0
- data/lib/sts/iso_sts/table_wrap.rb +1 -0
- data/lib/sts/iso_sts/table_wrap_foot.rb +3 -0
- data/lib/sts/iso_sts/td.rb +32 -14
- data/lib/sts/iso_sts/term.rb +6 -6
- data/lib/sts/iso_sts/term_sec.rb +1 -0
- data/lib/sts/iso_sts/th.rb +32 -14
- data/lib/sts/iso_sts/title.rb +17 -7
- data/lib/sts/iso_sts/title_compl.rb +2 -0
- data/lib/sts/iso_sts/title_full.rb +2 -0
- data/lib/sts/iso_sts/title_intro.rb +2 -0
- data/lib/sts/iso_sts/title_main.rb +2 -0
- data/lib/sts/iso_sts/title_wrap.rb +1 -0
- data/lib/sts/iso_sts/tr.rb +1 -0
- data/lib/sts/iso_sts/underline.rb +26 -0
- data/lib/sts/iso_sts/uri.rb +32 -0
- data/lib/sts/iso_sts/xref.rb +3 -3
- data/lib/sts/iso_sts.rb +11 -0
- data/lib/sts/mathml.rb +21 -0
- data/lib/sts/namespaces.rb +3 -0
- data/lib/sts/niso_sts/abstract.rb +3 -0
- data/lib/sts/niso_sts/access_date.rb +2 -0
- data/lib/sts/niso_sts/accrediting_organization.rb +2 -0
- data/lib/sts/niso_sts/ack.rb +1 -1
- data/lib/sts/niso_sts/addr_line.rb +2 -0
- data/lib/sts/niso_sts/address.rb +3 -0
- data/lib/sts/niso_sts/adoption.rb +1 -1
- data/lib/sts/niso_sts/adoption_front.rb +1 -0
- data/lib/sts/niso_sts/aff_alternatives.rb +3 -0
- data/lib/sts/niso_sts/alt_text.rb +2 -0
- data/lib/sts/niso_sts/alt_title.rb +2 -0
- data/lib/sts/niso_sts/alternatives.rb +3 -4
- data/lib/sts/niso_sts/annotation.rb +1 -3
- data/lib/sts/niso_sts/anonymous.rb +3 -0
- data/lib/sts/niso_sts/app.rb +16 -1
- data/lib/sts/niso_sts/app_group.rb +5 -0
- data/lib/sts/niso_sts/article_title.rb +2 -0
- data/lib/sts/niso_sts/attrib.rb +2 -0
- data/lib/sts/niso_sts/author_comment.rb +1 -3
- data/lib/sts/niso_sts/author_notes.rb +1 -1
- data/lib/sts/niso_sts/authorization.rb +2 -0
- data/lib/sts/niso_sts/award_group.rb +23 -4
- data/lib/sts/niso_sts/award_id.rb +6 -0
- data/lib/sts/niso_sts/back.rb +25 -6
- data/lib/sts/niso_sts/bio.rb +1 -3
- data/lib/sts/niso_sts/body.rb +38 -0
- data/lib/sts/niso_sts/boxed_text.rb +41 -3
- data/lib/sts/niso_sts/break.rb +14 -0
- data/lib/sts/niso_sts/caption.rb +15 -1
- data/lib/sts/niso_sts/chapter_title.rb +2 -0
- data/lib/sts/niso_sts/chem_struct.rb +2 -0
- data/lib/sts/niso_sts/chem_struct_wrap.rb +1 -0
- data/lib/sts/niso_sts/citation_alternatives.rb +3 -0
- data/lib/sts/niso_sts/city.rb +2 -0
- data/lib/sts/niso_sts/code.rb +111 -0
- data/lib/sts/niso_sts/collab.rb +8 -0
- data/lib/sts/niso_sts/collab_alternatives.rb +3 -0
- data/lib/sts/niso_sts/comm_ref_group.rb +3 -0
- data/lib/sts/niso_sts/comment.rb +2 -0
- data/lib/sts/niso_sts/compound_subject.rb +29 -0
- data/lib/sts/niso_sts/compound_subject_part.rb +39 -0
- data/lib/sts/niso_sts/conf_acronym.rb +2 -0
- data/lib/sts/niso_sts/conf_date.rb +2 -0
- data/lib/sts/niso_sts/conf_loc.rb +2 -0
- data/lib/sts/niso_sts/conf_name.rb +2 -0
- data/lib/sts/niso_sts/conf_num.rb +2 -0
- data/lib/sts/niso_sts/conf_sponsor.rb +2 -0
- data/lib/sts/niso_sts/conf_theme.rb +2 -0
- data/lib/sts/niso_sts/conference.rb +3 -0
- data/lib/sts/niso_sts/content_language.rb +2 -0
- data/lib/sts/niso_sts/contrib.rb +1 -0
- data/lib/sts/niso_sts/contrib_group.rb +1 -0
- data/lib/sts/niso_sts/contrib_id.rb +2 -0
- data/lib/sts/niso_sts/copyright_holder.rb +2 -0
- data/lib/sts/niso_sts/copyright_statement.rb +2 -0
- data/lib/sts/niso_sts/copyright_year.rb +2 -0
- data/lib/sts/niso_sts/country.rb +2 -0
- data/lib/sts/niso_sts/counts.rb +3 -0
- data/lib/sts/niso_sts/custom_meta.rb +3 -0
- data/lib/sts/niso_sts/custom_meta_group.rb +3 -0
- data/lib/sts/niso_sts/data_title.rb +29 -0
- data/lib/sts/niso_sts/date.rb +3 -0
- data/lib/sts/niso_sts/date_in_citation.rb +2 -0
- data/lib/sts/niso_sts/day.rb +2 -0
- data/lib/sts/niso_sts/def.rb +3 -0
- data/lib/sts/niso_sts/def_head.rb +18 -0
- data/lib/sts/niso_sts/def_item.rb +13 -0
- data/lib/sts/niso_sts/def_list.rb +25 -3
- data/lib/sts/niso_sts/degrees.rb +2 -0
- data/lib/sts/niso_sts/disp_formula_group.rb +1 -4
- data/lib/sts/niso_sts/disp_quote.rb +3 -1
- data/lib/sts/niso_sts/display_formula.rb +47 -2
- data/lib/sts/niso_sts/doc_number.rb +2 -0
- data/lib/sts/niso_sts/doc_type.rb +2 -0
- data/lib/sts/niso_sts/document_identification.rb +1 -0
- data/lib/sts/niso_sts/editing_instruction.rb +9 -5
- data/lib/sts/niso_sts/edition.rb +2 -0
- data/lib/sts/niso_sts/element_citation.rb +1 -1
- data/lib/sts/niso_sts/elocation_id.rb +2 -0
- data/lib/sts/niso_sts/email.rb +2 -0
- data/lib/sts/niso_sts/equation_count.rb +2 -0
- data/lib/sts/niso_sts/era.rb +2 -0
- data/lib/sts/niso_sts/ext_link.rb +32 -2
- data/lib/sts/niso_sts/fax.rb +2 -0
- data/lib/sts/niso_sts/fig_count.rb +2 -0
- data/lib/sts/niso_sts/fig_group.rb +1 -0
- data/lib/sts/niso_sts/figure.rb +14 -1
- data/lib/sts/niso_sts/floats_group.rb +3 -4
- data/lib/sts/niso_sts/fn.rb +2 -1
- data/lib/sts/niso_sts/fn_group.rb +3 -0
- data/lib/sts/niso_sts/fpage.rb +2 -0
- data/lib/sts/niso_sts/front.rb +16 -0
- data/lib/sts/niso_sts/funding_group.rb +1 -0
- data/lib/sts/niso_sts/funding_source.rb +2 -0
- data/lib/sts/niso_sts/given_names.rb +2 -0
- data/lib/sts/niso_sts/glossary.rb +1 -1
- data/lib/sts/niso_sts/gov.rb +2 -0
- data/lib/sts/niso_sts/graphic.rb +6 -0
- data/lib/sts/niso_sts/hr.rb +3 -0
- data/lib/sts/niso_sts/ics.rb +5 -0
- data/lib/sts/niso_sts/ics_desc.rb +2 -0
- data/lib/sts/niso_sts/ics_wrap.rb +9 -0
- data/lib/sts/niso_sts/index.rb +32 -0
- data/lib/sts/niso_sts/index_div.rb +30 -0
- data/lib/sts/niso_sts/index_entry.rb +32 -0
- data/lib/sts/niso_sts/index_term.rb +1 -0
- data/lib/sts/niso_sts/index_title_group.rb +22 -0
- data/lib/sts/niso_sts/inline_formula.rb +38 -2
- data/lib/sts/niso_sts/inline_media.rb +50 -0
- data/lib/sts/niso_sts/institution.rb +2 -0
- data/lib/sts/niso_sts/institution_id.rb +2 -0
- data/lib/sts/niso_sts/institution_wrap.rb +3 -0
- data/lib/sts/niso_sts/intro.rb +2 -0
- data/lib/sts/niso_sts/is_proof.rb +2 -0
- data/lib/sts/niso_sts/isbn.rb +2 -0
- data/lib/sts/niso_sts/issn.rb +2 -0
- data/lib/sts/niso_sts/issn_l.rb +2 -0
- data/lib/sts/niso_sts/issue.rb +2 -0
- data/lib/sts/niso_sts/kwd_group.rb +9 -0
- data/lib/sts/niso_sts/label.rb +7 -2
- data/lib/sts/niso_sts/legend.rb +39 -0
- data/lib/sts/niso_sts/license.rb +2 -0
- data/lib/sts/niso_sts/license_p.rb +2 -0
- data/lib/sts/niso_sts/list.rb +9 -2
- data/lib/sts/niso_sts/list_item.rb +9 -4
- data/lib/sts/niso_sts/long_desc.rb +2 -0
- data/lib/sts/niso_sts/lpage.rb +2 -0
- data/lib/sts/niso_sts/main.rb +2 -0
- data/lib/sts/niso_sts/media.rb +1 -0
- data/lib/sts/niso_sts/meta_date.rb +2 -0
- data/lib/sts/niso_sts/meta_note.rb +1 -1
- data/lib/sts/niso_sts/metadata_iso.rb +1 -1
- data/lib/sts/niso_sts/metadata_std.rb +16 -8
- data/lib/sts/niso_sts/milestone_end.rb +1 -3
- data/lib/sts/niso_sts/milestone_start.rb +1 -3
- data/lib/sts/niso_sts/mixed_citation.rb +22 -0
- data/lib/sts/niso_sts/mml_content.rb +0 -2
- data/lib/sts/niso_sts/monospace.rb +9 -0
- data/lib/sts/niso_sts/month.rb +2 -0
- data/lib/sts/niso_sts/name.rb +3 -0
- data/lib/sts/niso_sts/name_alternatives.rb +5 -0
- data/lib/sts/niso_sts/named_content.rb +51 -1
- data/lib/sts/niso_sts/nat_meta.rb +3 -0
- data/lib/sts/niso_sts/nested_kwd.rb +3 -0
- data/lib/sts/niso_sts/nlm_citation.rb +1 -1
- data/lib/sts/niso_sts/non_normative_example.rb +15 -2
- data/lib/sts/niso_sts/non_normative_note.rb +14 -2
- data/lib/sts/niso_sts/normative_example.rb +1 -1
- data/lib/sts/niso_sts/normative_note.rb +3 -1
- data/lib/sts/niso_sts/note.rb +1 -1
- data/lib/sts/niso_sts/notes.rb +1 -1
- data/lib/sts/niso_sts/notes_group.rb +1 -0
- data/lib/sts/niso_sts/object_id.rb +4 -0
- data/lib/sts/niso_sts/on_behalf_of.rb +2 -0
- data/lib/sts/niso_sts/open_access.rb +3 -4
- data/lib/sts/niso_sts/originator.rb +2 -0
- data/lib/sts/niso_sts/page_count.rb +2 -0
- data/lib/sts/niso_sts/page_range.rb +2 -0
- data/lib/sts/niso_sts/paragraph.rb +39 -7
- data/lib/sts/niso_sts/part_number.rb +2 -0
- data/lib/sts/niso_sts/part_of_speech.rb +2 -0
- data/lib/sts/niso_sts/patent.rb +2 -0
- data/lib/sts/niso_sts/permissions.rb +7 -1
- data/lib/sts/niso_sts/phone.rb +2 -0
- data/lib/sts/niso_sts/postal_code.rb +2 -0
- data/lib/sts/niso_sts/prefix.rb +2 -0
- data/lib/sts/niso_sts/preformat.rb +15 -0
- data/lib/sts/niso_sts/price.rb +2 -0
- data/lib/sts/niso_sts/principal_award_recipient.rb +2 -0
- data/lib/sts/niso_sts/principal_investigator.rb +2 -0
- data/lib/sts/niso_sts/private_char.rb +3 -3
- data/lib/sts/niso_sts/processing_meta.rb +54 -0
- data/lib/sts/niso_sts/product.rb +2 -0
- data/lib/sts/niso_sts/proj_id.rb +2 -0
- data/lib/sts/niso_sts/pub_date.rb +4 -0
- data/lib/sts/niso_sts/pub_id.rb +2 -0
- data/lib/sts/niso_sts/publisher.rb +3 -0
- data/lib/sts/niso_sts/publisher_loc.rb +2 -0
- data/lib/sts/niso_sts/publisher_name.rb +2 -0
- data/lib/sts/niso_sts/ref_count.rb +2 -0
- data/lib/sts/niso_sts/reference.rb +1 -0
- data/lib/sts/niso_sts/reference_list.rb +6 -1
- data/lib/sts/niso_sts/reference_standard.rb +4 -2
- data/lib/sts/niso_sts/reg_meta.rb +3 -0
- data/lib/sts/niso_sts/related_term.rb +2 -0
- data/lib/sts/niso_sts/release_date.rb +11 -6
- data/lib/sts/niso_sts/release_version.rb +2 -0
- data/lib/sts/niso_sts/release_version_id.rb +2 -0
- data/lib/sts/niso_sts/role.rb +35 -0
- data/lib/sts/niso_sts/ruby.rb +1 -0
- data/lib/sts/niso_sts/sdo.rb +2 -0
- data/lib/sts/niso_sts/season.rb +2 -0
- data/lib/sts/niso_sts/sec_meta.rb +26 -0
- data/lib/sts/niso_sts/secretariat.rb +2 -0
- data/lib/sts/niso_sts/section.rb +47 -4
- data/lib/sts/niso_sts/see_also_entry.rb +26 -0
- data/lib/sts/niso_sts/see_entry.rb +26 -0
- data/lib/sts/niso_sts/self_uri.rb +2 -0
- data/lib/sts/niso_sts/series.rb +2 -0
- data/lib/sts/niso_sts/series_text.rb +2 -0
- data/lib/sts/niso_sts/series_title.rb +2 -0
- data/lib/sts/niso_sts/sig.rb +2 -0
- data/lib/sts/niso_sts/size.rb +2 -0
- data/lib/sts/niso_sts/source.rb +29 -0
- data/lib/sts/niso_sts/speaker.rb +2 -0
- data/lib/sts/niso_sts/speech.rb +1 -1
- data/lib/sts/niso_sts/standard.rb +3 -0
- data/lib/sts/niso_sts/standard_identification.rb +3 -1
- data/lib/sts/niso_sts/state.rb +2 -0
- data/lib/sts/niso_sts/statement.rb +1 -1
- data/lib/sts/niso_sts/std_doc_meta.rb +50 -11
- data/lib/sts/niso_sts/std_id.rb +2 -0
- data/lib/sts/niso_sts/std_id_group.rb +3 -0
- data/lib/sts/niso_sts/std_org.rb +1 -0
- data/lib/sts/niso_sts/std_org_abbrev.rb +2 -0
- data/lib/sts/niso_sts/std_org_group.rb +3 -0
- data/lib/sts/niso_sts/std_org_name.rb +2 -0
- data/lib/sts/niso_sts/std_organization.rb +2 -0
- data/lib/sts/niso_sts/string_conf.rb +2 -0
- data/lib/sts/niso_sts/string_date.rb +2 -0
- data/lib/sts/niso_sts/string_name.rb +2 -0
- data/lib/sts/niso_sts/styled_content.rb +39 -0
- data/lib/sts/niso_sts/sub.rb +11 -0
- data/lib/sts/niso_sts/subj_group.rb +11 -0
- data/lib/sts/niso_sts/subtitle.rb +2 -0
- data/lib/sts/niso_sts/suffix.rb +2 -0
- data/lib/sts/niso_sts/sup.rb +13 -0
- data/lib/sts/niso_sts/suppl_number.rb +2 -0
- data/lib/sts/niso_sts/suppl_type.rb +2 -0
- data/lib/sts/niso_sts/suppl_version.rb +2 -0
- data/lib/sts/niso_sts/supplementary_material.rb +1 -0
- data/lib/sts/niso_sts/surname.rb +2 -0
- data/lib/sts/niso_sts/table_count.rb +2 -0
- data/lib/sts/niso_sts/table_wrap_group.rb +32 -0
- data/lib/sts/niso_sts/term_display.rb +22 -0
- data/lib/sts/niso_sts/term_display_string.rb +22 -0
- data/lib/sts/niso_sts/term_head.rb +2 -0
- data/lib/sts/niso_sts/term_section.rb +3 -3
- data/lib/sts/niso_sts/term_source.rb +2 -0
- data/lib/sts/niso_sts/tex_math.rb +2 -0
- data/lib/sts/niso_sts/textual_form.rb +2 -0
- data/lib/sts/niso_sts/time_stamp.rb +2 -0
- data/lib/sts/niso_sts/title.rb +26 -0
- data/lib/sts/niso_sts/title_wrap.rb +2 -0
- data/lib/sts/niso_sts/toc.rb +32 -0
- data/lib/sts/niso_sts/toc_div.rb +30 -0
- data/lib/sts/niso_sts/toc_entry.rb +30 -0
- data/lib/sts/niso_sts/toc_title_group.rb +22 -0
- data/lib/sts/niso_sts/trans_abstract.rb +1 -0
- data/lib/sts/niso_sts/trans_source.rb +2 -0
- data/lib/sts/niso_sts/trans_title.rb +2 -0
- data/lib/sts/niso_sts/trans_title_group.rb +3 -0
- data/lib/sts/niso_sts/underline.rb +5 -0
- data/lib/sts/niso_sts/uri.rb +4 -0
- data/lib/sts/niso_sts/urn.rb +2 -0
- data/lib/sts/niso_sts/verse_group.rb +1 -1
- data/lib/sts/niso_sts/verse_line.rb +2 -0
- data/lib/sts/niso_sts/version.rb +2 -0
- data/lib/sts/niso_sts/volume.rb +2 -0
- data/lib/sts/niso_sts/volume_id.rb +2 -0
- data/lib/sts/niso_sts/volume_issue_group.rb +3 -4
- data/lib/sts/niso_sts/volume_series.rb +2 -0
- data/lib/sts/niso_sts/word_count.rb +2 -0
- data/lib/sts/niso_sts/year.rb +2 -0
- data/lib/sts/niso_sts.rb +35 -10
- data/lib/sts/profiles/iso_iec/constraints.rb +43 -0
- data/lib/sts/profiles/iso_iec/validator.rb +73 -0
- data/lib/sts/profiles/iso_iec.rb +10 -0
- data/lib/sts/profiles.rb +7 -0
- data/lib/sts/tbx_iso_tml/bold.rb +30 -1
- data/lib/sts/tbx_iso_tml/caption.rb +3 -0
- data/lib/sts/tbx_iso_tml/col.rb +10 -0
- data/lib/sts/tbx_iso_tml/cross_reference.rb +2 -0
- data/lib/sts/tbx_iso_tml/definition.rb +18 -2
- data/lib/sts/tbx_iso_tml/entailed_term.rb +2 -0
- data/lib/sts/tbx_iso_tml/example.rb +9 -3
- data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -0
- data/lib/sts/tbx_iso_tml/external_source.rb +2 -0
- data/lib/sts/tbx_iso_tml/fn.rb +3 -2
- data/lib/sts/tbx_iso_tml/fn_group.rb +3 -0
- data/lib/sts/tbx_iso_tml/geographical_usage.rb +3 -0
- data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -0
- data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -0
- data/lib/sts/tbx_iso_tml/italic.rb +27 -1
- data/lib/sts/tbx_iso_tml/lang_set.rb +2 -0
- data/lib/sts/tbx_iso_tml/mfenced.rb +2 -0
- data/lib/sts/tbx_iso_tml/mfrac.rb +2 -2
- data/lib/sts/tbx_iso_tml/mi.rb +3 -2
- data/lib/sts/tbx_iso_tml/mrow.rb +2 -2
- data/lib/sts/tbx_iso_tml/mspace.rb +2 -0
- data/lib/sts/tbx_iso_tml/mstyle.rb +2 -2
- data/lib/sts/tbx_iso_tml/msub.rb +2 -0
- data/lib/sts/tbx_iso_tml/msup.rb +4 -1
- data/lib/sts/tbx_iso_tml/munder.rb +3 -0
- data/lib/sts/tbx_iso_tml/munderover.rb +2 -0
- data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -0
- data/lib/sts/tbx_iso_tml/note.rb +11 -7
- data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -0
- data/lib/sts/tbx_iso_tml/pronunciation.rb +3 -0
- data/lib/sts/tbx_iso_tml/see.rb +2 -0
- data/lib/sts/tbx_iso_tml/semantics.rb +2 -0
- data/lib/sts/tbx_iso_tml/source.rb +6 -0
- data/lib/sts/tbx_iso_tml/subject_field.rb +2 -0
- data/lib/sts/tbx_iso_tml/sup.rb +3 -2
- data/lib/sts/tbx_iso_tml/table.rb +1 -0
- data/lib/sts/tbx_iso_tml/table_wrap.rb +3 -1
- data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +3 -0
- data/lib/sts/tbx_iso_tml/tbody.rb +9 -1
- data/lib/sts/tbx_iso_tml/td.rb +122 -17
- data/lib/sts/tbx_iso_tml/term.rb +9 -5
- data/lib/sts/tbx_iso_tml/term_type.rb +2 -0
- data/lib/sts/tbx_iso_tml/tfoot.rb +5 -1
- data/lib/sts/tbx_iso_tml/th.rb +133 -18
- data/lib/sts/tbx_iso_tml/thead.rb +9 -1
- data/lib/sts/tbx_iso_tml/tr.rb +16 -0
- data/lib/sts/tbx_iso_tml/xref.rb +2 -2
- data/lib/sts/version.rb +1 -1
- data/lib/sts.rb +1 -2
- data/reference-docs/Guidelines for coding ed.2.1.pdf +0 -0
- data/reference-docs/NISO-STS-1-2-compare-1-0.pdf +0 -0
- data/reference-docs/NISOSTS-guidelines-v1.0.pdf +0 -0
- metadata +76 -3
- data/lib/sts/niso_sts/mathml.rb +0 -69
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Section 10: ISO-IEC Variant and Amendments
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Covers the ISO/IEC-specific features: IEC amendments with `<editing-instruction>`, ISO amendments, IEC Corrigenda, IEC Interpretation Sheets (ISH), IEC Software supplements, and the ID schemes for both IEC and ISO.
|
|
5
|
+
|
|
6
|
+
## ISO vs IEC Variant Support
|
|
7
|
+
|
|
8
|
+
### Structural Differences
|
|
9
|
+
|
|
10
|
+
| Feature | ISO Variant | IEC Variant | sts-ruby Support | Notes |
|
|
11
|
+
|---------|------------|-------------|-----------------|-------|
|
|
12
|
+
| Root element | `<standard>` | `<standard>` | ✅ Both | NisoSts and IsoSts variants |
|
|
13
|
+
| Metadata element | `<iso-meta>` (legacy), `<std-meta>` | `<std-meta>` | ✅ Both | |
|
|
14
|
+
| ID separator | Underscore (`sec_1`) | Dash (`sec-1`) | ✅ Values in `@id` | IDs are free-form strings |
|
|
15
|
+
| `<annex-type>` | Text: "(informative)" | Not rendered (from `@content-type`) | ✅ Both approaches | |
|
|
16
|
+
| `@content-type` on `<app>` | "inform-annex" / "normative-annex" | "inform" / "norm" (legacy), "informative" / "normative" (future) | ✅ Mapped | |
|
|
17
|
+
| `<bold>` in table headers | Yes | No (auto-bold, use `<roman>` for plain) | ✅ Both elements exist | |
|
|
18
|
+
| Footnote placement | At point of use | `<fn-group>` in `<back>` (legacy) | ✅ Both approaches | |
|
|
19
|
+
| Amendment style | Separate text, no semantic instructions | `<editing-instruction>` with types | ⚠️ Partial | EditingInstruction model incomplete |
|
|
20
|
+
| Formula groups | Not used | Used (IEC) | ✅ DispFormulaGroup exists | |
|
|
21
|
+
|
|
22
|
+
### ID Schemes
|
|
23
|
+
|
|
24
|
+
#### ISO ID Scheme (from guidelines Annex)
|
|
25
|
+
|
|
26
|
+
| Element | Pattern | sts-ruby Support | Notes |
|
|
27
|
+
|---------|---------|-----------------|-------|
|
|
28
|
+
| Section: `sec_1`, `sec_1.2.1` | `sec_{number}` | ✅ String IDs | Free-form string attribute |
|
|
29
|
+
| Foreword: `sec_foreword` | `sec_foreword` | ✅ | |
|
|
30
|
+
| Introduction: `sec_intro` | `sec_intro` | ✅ | |
|
|
31
|
+
| Bibliography: `sec_bibl` | `sec_bibl` | ✅ | |
|
|
32
|
+
| Annex: `sec_A`, `sec_B.1` | `sec_{letter}` | ✅ | |
|
|
33
|
+
| Bibliography ref: `biblref_1` | `biblref_{label}` | ✅ | |
|
|
34
|
+
| Term: `term_3.1` | `term_{number}` | ✅ | |
|
|
35
|
+
| Table: `tab_1` | `tab_{number}` | ✅ | |
|
|
36
|
+
| Figure: `fig_1` | `fig_{number}` | ✅ | |
|
|
37
|
+
| Formula: `formula_1` | `formula_{number}` | ✅ | |
|
|
38
|
+
| Footnote: `fn_1` | `fn_{number}` | ✅ | |
|
|
39
|
+
| Table footnote: `table-fn_1.1` | `table-fn_{table}.{n}` | ✅ | |
|
|
40
|
+
|
|
41
|
+
#### IEC ID Scheme
|
|
42
|
+
|
|
43
|
+
| Element | Pattern | sts-ruby Support | Notes |
|
|
44
|
+
|---------|---------|-----------------|-------|
|
|
45
|
+
| Section: `sec-1` | `sec-{number}` | ✅ String IDs | |
|
|
46
|
+
| Foreword: `sec-foreword` | `sec-foreword` | ✅ | |
|
|
47
|
+
| Introduction: `sec-introduction` | `sec-introduction` | ✅ | |
|
|
48
|
+
| Bibliography: `sec-bibliography` | `sec-bibliography` | ✅ | |
|
|
49
|
+
| Index: `sec-index` | `sec-index` | ✅ | |
|
|
50
|
+
| Annex: `anx-A` | `anx-{letter}` | ✅ | |
|
|
51
|
+
| Bibliography ref: `bib-1` | `bib-{label or seq}` | ✅ | |
|
|
52
|
+
| Concept: `con-3.2.1` | `con-{number}` | ✅ | |
|
|
53
|
+
| Term entry: `te-3.2.1` | `te-{number}` | ✅ | |
|
|
54
|
+
| Term: `ter-broadcast` | `ter-{term_text}` | ✅ | |
|
|
55
|
+
| Note to entry: `nte-3.4-1` | `nte-{section}-{seq}` | ✅ | |
|
|
56
|
+
| Table: `tab-1` | `tab-{number}` | ✅ | |
|
|
57
|
+
| Informal table: `tab-informal-5.3-1` | `tab-informal-{section}-{seq}` | ✅ | |
|
|
58
|
+
| Figure: `fig-1` | `fig-{number}` | ✅ | |
|
|
59
|
+
| Formula: `for-1` | `for-{number}` | ✅ | |
|
|
60
|
+
| Formula (unnumbered): `for-informal-5.6-1` | `for-informal-{section}-{seq}` | ✅ | |
|
|
61
|
+
| Formula group: `forg-informal-5.3.1-1` | `forg-informal-{section}-{seq}` | ✅ | |
|
|
62
|
+
| Math: `mml-1` | `mml-{seq}` | ✅ | |
|
|
63
|
+
| Footnote: `foo-1` | `foo-{number}` | ✅ | |
|
|
64
|
+
| Symbol footnote: `fos-1` | `fos-{seq}` | ✅ | |
|
|
65
|
+
| Table footnote: `tfn-1-1` | `tfn-{table}-{seq}` | ✅ | |
|
|
66
|
+
| Symbol table fn: `tfs-4-1` | `tfs-{table}-{seq}` | ✅ | |
|
|
67
|
+
| Figure note: `fno-4-1` | `fno-{figure}-{seq}` | ✅ | |
|
|
68
|
+
| Table note: `tno-4-1` | `tno-{table}-{seq}` | ✅ | |
|
|
69
|
+
| List item: `lis-5.6-L1-2` | `lis-{sec}-L{list}-{item}` | ✅ | |
|
|
70
|
+
| Note: `not-3.5-1` | `not-{sec}-{seq}` | ✅ | |
|
|
71
|
+
| Paragraph: `p-450` | `p-{seq}` | ✅ | |
|
|
72
|
+
|
|
73
|
+
## IEC Amendments (Annex C)
|
|
74
|
+
|
|
75
|
+
| Element | Guidelines Usage | sts-ruby Model | Status | Notes |
|
|
76
|
+
|---------|-----------------|---------------|--------|-------|
|
|
77
|
+
| `<editing-instruction>` | Amendment instructions | `NisoSts::EditingInstruction` | ⚠️ Partial | Missing `@content-type` and `<p>` child |
|
|
78
|
+
| `@content-type="addition"` | Addition instruction | ❌ Not mapped | Missing | |
|
|
79
|
+
| `@content-type="replacement"` | Replacement instruction | ❌ Not mapped | Missing | |
|
|
80
|
+
| `@content-type="deletion"` | Deletion instruction | ❌ Not mapped | Missing | |
|
|
81
|
+
| `@content-type="modification"` | Modification instruction | ❌ Not mapped | Missing | |
|
|
82
|
+
| `<p>` inside editing-instruction | Instruction text (e.g. "Addition:", "Replace:") | ❌ Not mapped | Missing | Guidelines show `<p><italic>Addition:</italic></p>` |
|
|
83
|
+
| `<italic>` inside editing-instruction `<p>` | Formatting | ❌ Not applicable | Missing because `<p>` not in model | |
|
|
84
|
+
| `<std>` inside editing-instruction | Standard references | ❌ Not applicable | Missing | |
|
|
85
|
+
| `<term-sec>` after editing-instruction | New terms in amendment | ✅ In parent section | OK | |
|
|
86
|
+
|
|
87
|
+
## ISO Amendments
|
|
88
|
+
|
|
89
|
+
| Feature | Guidelines Usage | sts-ruby Support | Status | Notes |
|
|
90
|
+
|---------|-----------------|-----------------|--------|-------|
|
|
91
|
+
| Separate document text | No semantic markup | ✅ Sections handle plain text | OK | |
|
|
92
|
+
| TBX terms in amendments | `<term-sec>` with `<tbx:termEntry>` | ✅ | OK | |
|
|
93
|
+
|
|
94
|
+
## IEC Corrigenda
|
|
95
|
+
|
|
96
|
+
| Feature | Guidelines Usage | sts-ruby Support | Status |
|
|
97
|
+
|---------|-----------------|-----------------|--------|
|
|
98
|
+
| Integrated into base publication | Content updated inline | N/A | Not a separate XML structure |
|
|
99
|
+
|
|
100
|
+
## IEC Interpretation Sheets (ISH)
|
|
101
|
+
|
|
102
|
+
| Element | Guidelines Usage | sts-ruby Model | Status | Notes |
|
|
103
|
+
|---------|-----------------|---------------|--------|-------|
|
|
104
|
+
| `<supplementary-material>` | Link to ISH PDF | `NisoSts::SupplementaryMaterial` | ✅ Class exists | With `@xlink:href` |
|
|
105
|
+
| `<supplementary-material>` in `<p>` (foreword) | Mentioning ISH inclusion | ❌ Not in Paragraph | Missing | Paragraph does not map `<supplementary-material>` |
|
|
106
|
+
|
|
107
|
+
## IEC Software Supplements
|
|
108
|
+
|
|
109
|
+
| Element | Guidelines Usage | sts-ruby Model | Status | Notes |
|
|
110
|
+
|---------|-----------------|---------------|--------|-------|
|
|
111
|
+
| `<supplementary-material xlink:href="asset/...">` | Link to supplement files | ✅ Class exists | OK | |
|
|
112
|
+
| `<supplementary-material>` in `<p>` | In foreword text | ❌ Not in Paragraph | Missing | Same as ISH above |
|
|
113
|
+
|
|
114
|
+
## Key Gaps
|
|
115
|
+
|
|
116
|
+
- [ ] **`EditingInstruction` is critically incomplete for IEC amendments**: Missing `@content-type` (values: addition, replacement, deletion, modification) and `<p>` child element. IEC amendments rely entirely on this element.
|
|
117
|
+
|
|
118
|
+
- [ ] **`<supplementary-material>` not available in `<p>`**: Both IEC ISH and Software supplements need `<supplementary-material>` inside `<p>` in the foreword. `Paragraph` model does not include this element.
|
|
119
|
+
|
|
120
|
+
- [ ] **`Graphic` missing `id`, `label`, `caption` children for ISO sub-figures**: ISO uses `<graphic id="fig_1.1"><label>a)</label><caption><title>...</title></caption></graphic>` for sub-figure captions. The `Graphic` model only has `@xlink:href` and `<object-id>`.
|
|
121
|
+
|
|
122
|
+
- [ ] **IEC legacy `<tfoot>` not fully supported**: Legacy IEC tables may use `<tfoot>` element inside `<table>`. `TbxIsoTml::Table` does map `<tfoot>`, so this is OK.
|
|
123
|
+
|
|
124
|
+
- [ ] **No explicit support for amendment metadata**: Amendments have their own metadata structure (referencing the base publication). No specific amendment metadata model exists beyond standard `<std-meta>`.
|
|
125
|
+
|
|
126
|
+
- [ ] **`TableWrapFoot` missing legacy `<tr>/<td>` children**: Legacy IEC uses `<tr><td>` directly inside `<table-wrap-foot>`, not currently supported.
|
|
127
|
+
|
|
128
|
+
## Summary: ISO-IEC Variant Priority Gaps
|
|
129
|
+
|
|
130
|
+
Priority items for ISO-IEC variant support:
|
|
131
|
+
|
|
132
|
+
1. **HIGH**: `EditingInstruction` completion (`@content-type`, `<p>` child) -- critical for IEC amendments
|
|
133
|
+
2. **HIGH**: `<supplementary-material>` in `<p>` -- needed for IEC ISH and software supplements
|
|
134
|
+
3. **HIGH**: `<code>` element -- needed for technical standards content
|
|
135
|
+
4. **MEDIUM**: `@list-content` on `DefList` -- needed for formula keys, figure keys, abbreviation lists
|
|
136
|
+
5. **MEDIUM**: `Permissions` completion (`<license>`, rich `<copyright-statement>`) -- needed for IEC metadata
|
|
137
|
+
6. **MEDIUM**: `Graphic` sub-figure support (ISO) -- `id`, `label`, `caption` children
|
|
138
|
+
7. **MEDIUM**: `<index>` element hierarchy -- needed for back matter
|
|
139
|
+
8. **LOW**: MathML element coverage -- partial coverage exists, complex formulae may not round-trip
|
|
140
|
+
9. **LOW**: `<std-doc-meta>` wiring into `Front` -- used in adoption documents
|
|
141
|
+
10. **LOW**: `TermDisplay` completion -- IEC fallback for certain document types
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# NISO STS 1.0 Guidelines Audit: sts-ruby Gap Report Summary
|
|
2
|
+
|
|
3
|
+
**Date**: 2026-05-06
|
|
4
|
+
**Source**: NISO STS 1.0 - IEC/ISO Coding Guidelines (v. 1.0 / 2021-01-01)
|
|
5
|
+
**Audited against**: sts-ruby (branch rt-enhance-private)
|
|
6
|
+
|
|
7
|
+
## Model Inventory
|
|
8
|
+
|
|
9
|
+
| Namespace | Classes | Directory |
|
|
10
|
+
|-----------|---------|-----------|
|
|
11
|
+
| NisoSts | 285 | lib/sts/niso_sts/ |
|
|
12
|
+
| IsoSts | 76 | lib/sts/iso_sts/ |
|
|
13
|
+
| TbxIsoTml | 52 | lib/sts/tbx_iso_tml/ |
|
|
14
|
+
| Sts::Mathml | 1 | lib/sts/mathml.rb |
|
|
15
|
+
|
|
16
|
+
## Overall Assessment
|
|
17
|
+
|
|
18
|
+
sts-ruby provides **good foundational coverage** of the NISO STS 1.0 element set. All major structural elements (`<standard>`, `<front>`, `<body>`, `<back>`, `<sec>`, `<app>`, `<fig>`, `<table-wrap>`, `<p>`, `<list>`, `<xref>`, `<std>`, etc.) are modeled. The TBX terminology support is comprehensive with `termEntry`, `langSet`, `tig`, and related elements.
|
|
19
|
+
|
|
20
|
+
However, there are significant gaps in several areas that would prevent full round-trip fidelity with real-world NISO STS documents.
|
|
21
|
+
|
|
22
|
+
## Critical Gaps (Prevent Round-Trip Fidelity)
|
|
23
|
+
|
|
24
|
+
### 1. Missing Elements (No Model Exists)
|
|
25
|
+
|
|
26
|
+
| Element | Section | Impact |
|
|
27
|
+
|---------|---------|--------|
|
|
28
|
+
| `<index>` hierarchy (index, index-div, index-entry, index-title-group, see-entry, related-object) | 4.4.4 | Back matter index content lost |
|
|
29
|
+
| `<code>` with 7 attributes | 5.12 | Programming code content lost |
|
|
30
|
+
|
|
31
|
+
### 2. Incomplete Models (Exist but Missing Critical Parts)
|
|
32
|
+
|
|
33
|
+
| Model | Missing Parts | Impact |
|
|
34
|
+
|-------|--------------|--------|
|
|
35
|
+
| `Permissions` | `<license>`, `<license-p>`, `<license_ref>`, rich `<copyright-statement>` | IEC metadata with full license text lost |
|
|
36
|
+
| `EditingInstruction` | `@content-type`, `<p>` child | IEC amendment instructions degraded to empty elements |
|
|
37
|
+
| `TermDisplay` | `<term>`, `<def>`, `<list>`, `<xref>`, `<label>` | IEC term-display content lost |
|
|
38
|
+
| `DefList` | `@list-content` attribute | Formula/figure/abbreviation keys lose semantic meaning |
|
|
39
|
+
| `Graphic` | `@id`, `<label>`, `<caption>` children | ISO sub-figure captions lost |
|
|
40
|
+
| `Front` (NisoSts) | `<std-doc-meta>` wiring, multiple `<std-meta>` | Adoption documents and national metadata lost |
|
|
41
|
+
| `BoxedText` | Most valid children (table-wrap, fig, disp-formula, etc.) | Guidance boxes with complex content degraded |
|
|
42
|
+
|
|
43
|
+
### 3. Missing Child Element Wiring
|
|
44
|
+
|
|
45
|
+
| Parent | Missing Child | Impact |
|
|
46
|
+
|--------|--------------|--------|
|
|
47
|
+
| `<p>` (Paragraph) | `@content-type`, `<supplementary-material>`, `<inline-graphic>` | Unit statements and supplementary materials lost |
|
|
48
|
+
| `<sec>` (Section) | `<supplementary-material>`, `<normative-note>`, `<normative-example>`, `<code>`, `<media>` | Various content types lost |
|
|
49
|
+
| `<ref>` (Reference) | `<non-normative-note>` | Notes on references lost |
|
|
50
|
+
| `<std>` (ReferenceStandard) | `<styled-content>`, `<italic>` | IEC amendment styled content lost |
|
|
51
|
+
|
|
52
|
+
### 4. Type Mismatches
|
|
53
|
+
|
|
54
|
+
| Model | Current | Should Be | Impact |
|
|
55
|
+
|-------|---------|-----------|--------|
|
|
56
|
+
| `Permissions#copyright_statement` | String | Structured (mixed content) | IEC inline-graphic and breaks lost |
|
|
57
|
+
| `Permissions#copyright_holder` | Single string | Collection | Multiple holders lost |
|
|
58
|
+
| `MetadataIso` fields (title_wrap, std_ref, etc.) | Single | Collection | Multi-language/multi-value data lost |
|
|
59
|
+
| `MetadataStd#page_count` | Direct | Wrapped in `<counts>` | IEC counts wrapper lost |
|
|
60
|
+
| `TableWrap#label` | String | Label (mixed content) | Superscript footnote markers lost |
|
|
61
|
+
|
|
62
|
+
## Medium-Priority Gaps
|
|
63
|
+
|
|
64
|
+
| Gap | Section | Notes |
|
|
65
|
+
|-----|---------|-------|
|
|
66
|
+
| `<abstract>` not in metadata models | A.2 | IEC metadata includes abstracts |
|
|
67
|
+
| `<isbn>`, `<suppl-type>`, `<suppl-number>` not in `StandardIdentification` | A.2 | IEC std-ident includes these |
|
|
68
|
+
| `@originator` missing from `StdId` | A.2 | IEC std-id uses this attribute |
|
|
69
|
+
| `<comm-ref>` should support `@id` | A.2 | IEC comm-ref has ID attribute |
|
|
70
|
+
| MathML coverage limited (~16 of 35+ elements) | 7.6 | Complex formulae may not round-trip |
|
|
71
|
+
| `DefItem` missing `@id` | 10.1.5 | Abbreviation cross-references need ID |
|
|
72
|
+
|
|
73
|
+
## Low-Priority Gaps
|
|
74
|
+
|
|
75
|
+
| Gap | Section | Notes |
|
|
76
|
+
|-----|---------|-------|
|
|
77
|
+
| Legacy IEC `<def-head>` vs `<label>` | 7.5 | Legacy only |
|
|
78
|
+
| Legacy IEC `<tfoot>` in tables | 6.6.3 | Legacy only |
|
|
79
|
+
| Legacy IEC `<tr>/<td>` in `<table-wrap-foot>` | 6.6.3 | Legacy only |
|
|
80
|
+
| `<editing-instruction>` `@content-type` (legacy) | 5.14 | Dropped in recent conversion |
|
|
81
|
+
| Text between disp-formula in disp-formula-group | 7.4 | Edge case |
|
|
82
|
+
|
|
83
|
+
## Files in This Report
|
|
84
|
+
|
|
85
|
+
| File | Topic |
|
|
86
|
+
|------|-------|
|
|
87
|
+
| `01-introduction-scope.md` | Sections 1-3: Introduction, scope, conventions |
|
|
88
|
+
| `02-document-structure.md` | Section 4: Overall document structure |
|
|
89
|
+
| `03-front-matter.md` | Section 4.2: Metadata elements |
|
|
90
|
+
| `04-body-content.md` | Section 5: Body content elements |
|
|
91
|
+
| `05-tables-figures.md` | Sections 6, 8: Tables and figures |
|
|
92
|
+
| `06-math-formulae.md` | Section 7: Formulae and MathML |
|
|
93
|
+
| `07-references.md` | Section 10: Cross-references and bibliography |
|
|
94
|
+
| `08-terminology.md` | Section 9: TBX and term-display |
|
|
95
|
+
| `09-metadata.md` | Annex A: Metadata usage |
|
|
96
|
+
| `10-iso-iec-variant.md` | ISO/IEC variants, amendments, ID schemes |
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Schema Element Coverage: mnconvert XSD vs sts-ruby
|
|
2
|
+
|
|
3
|
+
**Source**: NISO STS Extended 1.0 MathML3 XSD from mnconvert
|
|
4
|
+
**Date**: 2026-05-06
|
|
5
|
+
**Method**: Extracted all `xsd:element name=` declarations from XSD schema files, compared against all `map_element` and `element` declarations in sts-ruby.
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
| Metric | Count |
|
|
10
|
+
|--------|-------|
|
|
11
|
+
| XSD-defined elements | 374 |
|
|
12
|
+
| Ruby-mapped elements | 470* |
|
|
13
|
+
| Missing from Ruby | 52 |
|
|
14
|
+
| Extra in Ruby (not in XSD) | ~150** |
|
|
15
|
+
|
|
16
|
+
*Ruby count includes TBX, MathML, and content group helper elements that may map to the same XML element name with different namespace/module prefixes.
|
|
17
|
+
|
|
18
|
+
**Extra Ruby elements include TBX elements (urn:iso:std:iso:30042:ed-1 namespace), MathML elements, and internal helpers.
|
|
19
|
+
|
|
20
|
+
## Elements in XSD but NOT in sts-ruby
|
|
21
|
+
|
|
22
|
+
### Critical (Structural / Round-trip Impact)
|
|
23
|
+
|
|
24
|
+
| Element | Parent(s) in XSD | Notes |
|
|
25
|
+
|---------|-----------------|-------|
|
|
26
|
+
| `code` | Paragraph, Section, ListItem | Code blocks — entirely missing |
|
|
27
|
+
| `index` | Back | Index container |
|
|
28
|
+
| `index-div` | Index | Index division |
|
|
29
|
+
| `index-entry` | IndexDiv | Index entry |
|
|
30
|
+
| `index-group` | Sec, App | Index group |
|
|
31
|
+
| `index-title-group` | IndexDiv | Index title |
|
|
32
|
+
| `index-term-range-end` | IndexEntry | Range end marker |
|
|
33
|
+
| `table-wrap-group` | Sec, App | Grouped tables |
|
|
34
|
+
| `toc` | Front | Table of contents |
|
|
35
|
+
| `toc-div` | Toc | TOC division |
|
|
36
|
+
| `toc-entry` | TocDiv | TOC entry |
|
|
37
|
+
| `toc-group` | Sec | TOC group |
|
|
38
|
+
| `toc-title-group` | Toc | TOC title |
|
|
39
|
+
| `sec-meta` | Sec | Section metadata |
|
|
40
|
+
| `std-doc-meta` | Front | Standard document metadata |
|
|
41
|
+
|
|
42
|
+
### Table Model (OASIS CALS)
|
|
43
|
+
|
|
44
|
+
| Element | Notes |
|
|
45
|
+
|---------|-------|
|
|
46
|
+
| `tgroup` | OASIS table group — alternative to XHTML table model |
|
|
47
|
+
| `colspec` | Column specification for OASIS tables |
|
|
48
|
+
| `row` | Row in OASIS table |
|
|
49
|
+
| `entry` | Cell in OASIS table |
|
|
50
|
+
|
|
51
|
+
sts-ruby only supports XHTML-style `<table>` with `<tr>/<td>/<th>`. OASIS CALS table model (`<tgroup>/<colspec>/<row>/<entry>`) is unimplemented.
|
|
52
|
+
|
|
53
|
+
### Less Critical / Edge Cases
|
|
54
|
+
|
|
55
|
+
| Element | Notes |
|
|
56
|
+
|---------|-------|
|
|
57
|
+
| `abbrev` | Abbreviation element (abbreviation display) |
|
|
58
|
+
| `article-categories` | JATS legacy — not used in NISO STS |
|
|
59
|
+
| `article-id` | JATS legacy |
|
|
60
|
+
| `article-meta` | JATS legacy |
|
|
61
|
+
| `compl-title-wrap` | Complementary title wrap |
|
|
62
|
+
| `compound-subject` | Compound subject |
|
|
63
|
+
| `compound-subject-part` | Part of compound subject |
|
|
64
|
+
| `count` | Count element |
|
|
65
|
+
| `externalCrossReference` | TBX external cross reference |
|
|
66
|
+
| `fallback` | Alternatives fallback |
|
|
67
|
+
| `fixed-case` | Fixed-case text |
|
|
68
|
+
| `free_to_read` | ALI free-to-read indicator |
|
|
69
|
+
| `glyph-data` | Private character glyph data |
|
|
70
|
+
| `glyph-ref` | Private character glyph reference |
|
|
71
|
+
| `include` | XInclude element |
|
|
72
|
+
| `intro-title-wrap` | Introduction title wrap |
|
|
73
|
+
| `issue-id` | Journal issue ID |
|
|
74
|
+
| `issue-part` | Journal issue part |
|
|
75
|
+
| `issue-sponsor` | Journal issue sponsor |
|
|
76
|
+
| `issue-title` | Journal issue title |
|
|
77
|
+
| `journal-id` | Journal ID |
|
|
78
|
+
| `license_ref` | ALI license reference (ali:license_ref) |
|
|
79
|
+
| `main-title-wrap` | Main title wrap |
|
|
80
|
+
| `nav-pointer` | Navigation pointer |
|
|
81
|
+
| `nav-pointer-group` | Navigation pointer group |
|
|
82
|
+
| `num` | Number element |
|
|
83
|
+
| `overline-end` | Overline end marker |
|
|
84
|
+
| `overline-start` | Overline start marker |
|
|
85
|
+
| `part-title` | Part title |
|
|
86
|
+
| `see-also-entry` | Index "see also" entry |
|
|
87
|
+
| `see-entry` | Index "see" entry |
|
|
88
|
+
| `sub-part` | Sub-part element |
|
|
89
|
+
| `title-group` | Title group |
|
|
90
|
+
| `trans-subtitle` | Translated subtitle |
|
|
91
|
+
| `underline-end` | Underline end marker |
|
|
92
|
+
| `underline-start` | Underline start marker |
|
|
93
|
+
| `x` | MathML x element |
|
|
94
|
+
| `xMathML` | Content MathML |
|
|
95
|
+
|
|
96
|
+
## Recommendations
|
|
97
|
+
|
|
98
|
+
1. **Immediate priority**: `code`, `index/*`, `toc/*`, `table-wrap-group` — these appear in real ISO documents
|
|
99
|
+
2. **OASIS table model**: Consider if needed — most modern ISO documents use XHTML tables
|
|
100
|
+
3. **JATS legacy elements**: Skip — not relevant for NISO STS standards documents
|
|
101
|
+
4. **ALI namespace elements** (`free_to_read`, `license_ref`): Add when supporting ALI permissions
|
data/Gemfile
CHANGED
|
@@ -6,10 +6,11 @@ source "https://rubygems.org"
|
|
|
6
6
|
gemspec
|
|
7
7
|
|
|
8
8
|
gem "canon"
|
|
9
|
-
gem "lutaml-model",
|
|
9
|
+
gem "lutaml-model", "~> 0.8.0"
|
|
10
10
|
gem "rake"
|
|
11
11
|
gem "rspec"
|
|
12
12
|
gem "rubocop"
|
|
13
13
|
gem "rubocop-performance"
|
|
14
14
|
gem "rubocop-rake"
|
|
15
15
|
gem "rubocop-rspec"
|
|
16
|
+
gem "simplecov", require: false
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# STS-Ruby Refactoring TODO Overview
|
|
2
|
+
|
|
3
|
+
**Date**: 2026-05-06
|
|
4
|
+
**Priority Order**: Execute in numeric order, dependencies noted
|
|
5
|
+
**Total Files**: 11
|
|
6
|
+
|
|
7
|
+
## Architecture Principles
|
|
8
|
+
- **MECE**: Mutually Exclusive, Collectively Exhaustive task organization
|
|
9
|
+
- **Model-Driven**: All elements defined via lutaml-model, no runtime string-lookup
|
|
10
|
+
- **Open/Closed**: Schema modules open for extension, closed for modification
|
|
11
|
+
- **DRY**: Content groups eliminate duplication; no copy-paste inheritance
|
|
12
|
+
- **No Anti-Patterns**: Never `send`, `respond_to`, `Object.const_get`, `method_missing`
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## File Inventory
|
|
17
|
+
|
|
18
|
+
| # | File | Category | Priority | Dependencies |
|
|
19
|
+
|---|------|----------|----------|--------------|
|
|
20
|
+
| 01 | `01-mathml-delegation.md` | Anti-Pattern Fix | DONE | — |
|
|
21
|
+
| 02 | `02-type-resolution.md` | Anti-Pattern Fix | DONE | — |
|
|
22
|
+
| 03 | `03-namespace-coupling.md` | Architecture | IN PROGRESS | 01, 02 |
|
|
23
|
+
| 04 | `04-register-versioning.md` | Architecture | HIGH | 01, 02 |
|
|
24
|
+
| 05 | `05-missing-elements.md` | Feature Gap | MOSTLY DONE | 04 |
|
|
25
|
+
| 06 | `06-missing-attributes.md` | Feature Gap | DONE | 04 |
|
|
26
|
+
| 07 | `07-incomplete-models.md` | Feature Gap | MOSTLY DONE | 04 |
|
|
27
|
+
| 08 | `08-isoiec-profile.md` | Architecture | DONE | 04 |
|
|
28
|
+
| 09 | `09-autoload-cleanup.md` | Cleanup | DONE | 01, 03 |
|
|
29
|
+
| 10 | `10-test-coverage.md` | Quality | ONGOING | All |
|
|
30
|
+
| 11 | `11-duplicate-models.md` | Architecture | MEDIUM | 03, 04 |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick Reference: Critical Gaps from Audit
|
|
35
|
+
|
|
36
|
+
### From GAPS.guidelines.iso-sts-ed2.1/
|
|
37
|
+
- ~~`<processing-meta>` (Ed 2.1 new element) — NOT modeled~~ → DONE
|
|
38
|
+
- ~~`<code>`, `<inline-code>` — NOT modeled~~ → DONE
|
|
39
|
+
- ~~`<legend>` — NOT modeled~~ → DONE
|
|
40
|
+
- ~~7+ elements missing `@id` attribute~~ → DONE: all 7 have `@id`
|
|
41
|
+
- ~~`Permissions` incomplete~~ → DONE
|
|
42
|
+
- ~~`Graphic` missing `@id`~~ → DONE
|
|
43
|
+
|
|
44
|
+
### From GAPS.guidelines.niso-sts-v1.0/
|
|
45
|
+
- ~~`<index>` hierarchy entirely missing~~ → DONE (Index, IndexDiv, IndexEntry, IndexTitleGroup, SeeEntry, SeeAlsoEntry)
|
|
46
|
+
- ~~`<toc>` hierarchy entirely missing~~ → DONE (Toc, TocDiv, TocEntry, TocTitleGroup)
|
|
47
|
+
- ~~`TermDisplay` incomplete~~ → DONE
|
|
48
|
+
- ~~`@xml:lang` on multilingual elements~~ → DONE (Label, Caption, DefItem, DefList, etc.)
|
|
49
|
+
- ~~`BoxedText` incomplete~~ → DONE (full children, form-type, originator)
|
|
50
|
+
- ~~`Front` missing std-doc-meta, toc~~ → DONE
|
|
51
|
+
- ~~`Back` missing index, toc, glossary~~ → DONE
|
|
52
|
+
- ~~`@originator` missing on 7+ elements~~ → DONE (Paragraph, Section, Abstract, App, DispQuote, List, NormativeNote, NonNormativeNote)
|
|
53
|
+
|
|
54
|
+
### From GAPS.guidelines.schema-xref.md
|
|
55
|
+
- ~~`<sec-meta>` — NOT modeled (lower priority)~~ → DONE
|
|
56
|
+
- OASIS CALS table model unsupported (legacy, lower priority)
|
|
57
|
+
- ~~NISO STS 1.2 additions partially done~~ → DONE (vocab, style-detail, use-type attrs on IcsWrap, KwdGroup, NamedContent, Role, SubjGroup)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Completed (2026-05-06)
|
|
62
|
+
|
|
63
|
+
### 01-mathml-delegation.md ✅
|
|
64
|
+
- Replaced `lib/sts/mathml.rb` (had `method_missing`, `respond_to_missing?`, `.send`)
|
|
65
|
+
- New version is a thin type alias: `Sts::Mathml::Math = Mml::V3::Math`
|
|
66
|
+
- All actual MathML elements used directly from `Mml::V3::*`
|
|
67
|
+
|
|
68
|
+
### 02-type-resolution.md ✅
|
|
69
|
+
- Replaced `Object.const_get` in `lib/sts/content_groups/helpers.rb`
|
|
70
|
+
- `inject_elements` now takes actual class objects (compile-time safe)
|
|
71
|
+
- Updated docstrings with tuple format documentation
|
|
72
|
+
|
|
73
|
+
### Dead Code Removed
|
|
74
|
+
- `lib/sts/iso_sts/content_groups/` — entire directory (highlight_elements.rb
|
|
75
|
+
was only file that used helpers, but IsoSts models all define attributes
|
|
76
|
+
explicitly, so content groups were never called)
|
|
77
|
+
- `lib/sts/niso_sts/content_groups/` — entire directory (9 files, all dead
|
|
78
|
+
code — would crash with `NoMethodError` if ever loaded since they call
|
|
79
|
+
`inject_elements` which was never defined in NisoSts::ContentGroups)
|
|
80
|
+
|
|
81
|
+
### Anti-Pattern Audit Result
|
|
82
|
+
```
|
|
83
|
+
grep -r "method_missing|respond_to_missing|Object.const_get|\.send" lib/
|
|
84
|
+
# Zero matches
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Moxml Monkey-Patch Removed
|
|
88
|
+
- Removed the no-op monkey-patch on `Moxml::Adapter::Nokogiri.children`
|
|
89
|
+
- The patch was replacing `children` with an identical implementation
|
|
90
|
+
- Likely originally worked around a Moxml bug that was since fixed upstream
|
|
91
|
+
|
|
92
|
+
### @id Attributes Added (Partial TODO 06)
|
|
93
|
+
- `NisoSts::DefItem` — now has `@id`
|
|
94
|
+
- `NisoSts::Graphic` — now has `@id`
|
|
95
|
+
- `NisoSts::ListItem` — now has `@id`
|
|
96
|
+
- `NisoSts::ReferenceStandard` — now has `@id`
|
|
97
|
+
- `TbxIsoTml::Xref` — now has `@id`
|
|
98
|
+
- `TbxIsoTml::TableWrapFoot` — now has `@id`
|
|
99
|
+
|
|
100
|
+
### frozen_string_literal: true
|
|
101
|
+
- All 456 `.rb` files in `lib/` now have `# frozen_string_literal: true`
|
|
102
|
+
|
|
103
|
+
### Anti-Pattern Regression Test
|
|
104
|
+
- `spec/anti_patterns_spec.rb` — 1768 examples checking every lib file for:
|
|
105
|
+
`method_missing`, `respond_to_missing?`, `Object.const_get`, `.send()`
|
|
106
|
+
|
|
107
|
+
### Test Results
|
|
108
|
+
```
|
|
109
|
+
2058 examples, 0 failures, 1 pending
|
|
110
|
+
480 files inspected, no offenses detected
|
|
111
|
+
0 anti-patterns found in 459 lib files
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### @id Attributes Added to All Models (2026-05-07)
|
|
115
|
+
- 161 NisoSts models now have `@id` (XSD-verified)
|
|
116
|
+
- 32 TbxIsoTml models now have `@id`
|
|
117
|
+
- 29 IsoSts models now have `@id`
|
|
118
|
+
- Total: 222 models updated
|
|
119
|
+
|
|
120
|
+
### Table Cell Content Expansion (2026-05-07)
|
|
121
|
+
- `TbxIsoTml::Td` expanded from 18 children to 40+ children matching XSD inside-cell content model
|
|
122
|
+
- `TbxIsoTml::Th` expanded from 17 children to 40+ children matching XSD inside-cell content model
|
|
123
|
+
- Added: disp-formula, disp-formula-group, element-citation, mixed-citation, emphasis elements (overline, roman, sc, strike), fig, fig-group, inline-graphic, private-char, normative-note, normative-example, non-normative-example, email, ext-link, named-content, alternatives, code, media, preformat, target, array
|
|
124
|
+
- Note: disp-quote, speech, statement are NOT in XSD inside-cell group — NOT needed
|
|
125
|
+
|
|
126
|
+
### ISO/IEC Profile Validator (2026-05-07)
|
|
127
|
+
- `Sts::Profiles::IsoIec::Validator` with structural, metadata, originator, and doc-type validation
|
|
128
|
+
- `Sts::Profiles::IsoIec::Constraints` with frozen string constants
|
|
129
|
+
- 11 specs covering: valid doc, missing front/body, missing std-ident children, unrecognized originator/doc-type
|
|
130
|
+
- Zero anti-patterns: direct method calls only, no send/respond_to/const_get
|
|
131
|
+
|
|
132
|
+
### NameAlternatives Expansion (2026-05-07)
|
|
133
|
+
- Added `string-name` child to `NameAlternatives` per XSD name-alternatives.class
|
|
134
|
+
|
|
135
|
+
### Test Results (2026-05-07)
|
|
136
|
+
```
|
|
137
|
+
2085 examples, 0 failures, 1 pending
|
|
138
|
+
485 files inspected, no offenses detected
|
|
139
|
+
0 anti-patterns found in lib/
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### IsoSts Namespace Independence (2026-05-07)
|
|
143
|
+
- ARCHITECTURE DECISION: IsoSts and NisoSts must remain fully independent
|
|
144
|
+
- ISOSTS is frozen legacy; NISO STS evolves — combining them violates OCP
|
|
145
|
+
- Created 11 new IsoSts-specific types: Monospace, Sc, Strike, Underline, Uri,
|
|
146
|
+
NamedContent, StandardRef, MetaDate, ContentLanguage (with autoloads)
|
|
147
|
+
- Decoupled Bold, Italic, ExtLink to use IsoSts types instead of NisoSts
|
|
148
|
+
- Reduced IsoSts→NisoSts cross-references from 157 to 63 (60% reduction)
|
|
149
|
+
- 48 types still need IsoSts equivalents for complete independence
|
|
150
|
+
- Test coverage: 99.8% line coverage, 2121 examples passing
|
|
151
|
+
|
|
152
|
+
### Code Cleanup (2026-05-07)
|
|
153
|
+
- Removed redundant `require "lutaml/model"` from 13 files (already loaded by lib/sts.rb)
|
|
154
|
+
- Added SimpleCov coverage tracking with 80% minimum threshold
|
|
155
|
+
- Cleaned extra blank lines from require removal
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Remaining Work (2026-05-07)
|
|
160
|
+
|
|
161
|
+
### Small Items
|
|
162
|
+
- OASIS CALS table model (legacy, lower priority)
|
|
163
|
+
- ~~Expand table cell content (disp-quote, speech, statement in td — NISO STS 1.2)~~ → NOT in XSD inside-cell group; Td/Th expanded to full XSD inside-cell content model
|
|
164
|
+
- ~~Expand StringName usage (in contrib, element-citation, related-article — NISO STS 1.2)~~ → DONE: added to name-alternatives; already in person-group and mixed-citation
|
|
165
|
+
|
|
166
|
+
### Architectural Items (High Effort)
|
|
167
|
+
- `03-namespace-coupling.md` — IN PROGRESS: 157→63 IsoSts→NisoSts cross-references remaining
|
|
168
|
+
- `04-register-versioning.md` — Version the models via lutaml-model Registers
|
|
169
|
+
- `11-duplicate-models.md` — 44 overlapping element resolution (depends on 03)
|
|
170
|
+
|
|
171
|
+
## Next Action
|
|
172
|
+
Proceed with `03-namespace-coupling.md` — audit and resolve 157+ IsoSts→NisoSts cross-references.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# 01: MathML Delegation Anti-Pattern Fix
|
|
2
|
+
|
|
3
|
+
**Priority**: CRITICAL
|
|
4
|
+
**Category**: Anti-Pattern Elimination
|
|
5
|
+
**Estimated Effort**: Medium
|
|
6
|
+
**Files Affected**: `lib/sts/mathml.rb`
|
|
7
|
+
|
|
8
|
+
## Problem
|
|
9
|
+
|
|
10
|
+
Current `lib/sts/mathml.rb` uses three anti-patterns that violate encapsulation:
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
# Anti-Pattern 1: method_missing delegates everything to wrapped object
|
|
14
|
+
def method_missing(method_name, *args, &block)
|
|
15
|
+
if math.respond_to?(method_name)
|
|
16
|
+
math.send(method_name, *args, &block)
|
|
17
|
+
else
|
|
18
|
+
super
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Anti-Pattern 2: respond_to checks wrapped object internals
|
|
23
|
+
def respond_to_missing?(method_name, include_private = false)
|
|
24
|
+
math.respond_to?(method_name, include_private) || super
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Anti-Pattern 3: send bypasses encapsulation
|
|
28
|
+
math.send(method_name, *args, &block)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Why These Are Wrong
|
|
32
|
+
|
|
33
|
+
1. **`method_missing`**: Hides interface boundary, makes IDE/tools blind to actual API, creates invisible coupling
|
|
34
|
+
2. **`respond_to_missing?`**: Returns false positives for private/internal methods, breaks type checking
|
|
35
|
+
3. **`send`**: Bypasses access control, breaks encapsulation, no warning for private method calls
|
|
36
|
+
|
|
37
|
+
### Impact
|
|
38
|
+
|
|
39
|
+
- Debugging is harder — no clear call stack
|
|
40
|
+
- Static analysis tools (RuboCop, Sorbet) cannot understand the interface
|
|
41
|
+
- Mix of `method_missing` and explicit method definitions creates inconsistency
|
|
42
|
+
- Performance: `send` is slower than direct calls
|
|
43
|
+
|
|
44
|
+
## Solution
|
|
45
|
+
|
|
46
|
+
Replace delegation with **explicit forwarding** or **composition via inheritance** following the mml gem's register pattern.
|
|
47
|
+
|
|
48
|
+
### Option A: Explicit Forwardable (Preferred)
|
|
49
|
+
|
|
50
|
+
Create explicit delegation methods for the API we actually need:
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
module Sts
|
|
54
|
+
module Mathml
|
|
55
|
+
class Math < Lutaml::Model::Serializable
|
|
56
|
+
attribute :id, :string
|
|
57
|
+
attribute :display, :string
|
|
58
|
+
attribute :math, Mml::V3::Math
|
|
59
|
+
attribute :class, :string
|
|
60
|
+
attribute :style, :string
|
|
61
|
+
attribute :xref, :string
|
|
62
|
+
attribute :encoding, :string
|
|
63
|
+
attribute :maxsize, :string
|
|
64
|
+
attribute :minsize, :string
|
|
65
|
+
attribute :other, :string
|
|
66
|
+
attribute :otherpr, :string
|
|
67
|
+
|
|
68
|
+
xml do
|
|
69
|
+
namespace ::Sts::Namespaces::MathmlNamespace
|
|
70
|
+
element "math"
|
|
71
|
+
mixed_content
|
|
72
|
+
map_attribute :id, to: :id
|
|
73
|
+
map_attribute :display, to: :display
|
|
74
|
+
map_attribute :class, to: :class
|
|
75
|
+
map_attribute :style, to: :style
|
|
76
|
+
map_attribute :xref, to: :xref
|
|
77
|
+
map_attribute "encoding", to: :encoding
|
|
78
|
+
map_attribute "maxsize", to: :maxsize
|
|
79
|
+
map_attribute "minsize", to: :minsize
|
|
80
|
+
map_attribute "other", to: :other
|
|
81
|
+
map_attribute "otherpr", to: :otherpr
|
|
82
|
+
map_element "math", to: :math
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Delegate children/annotations explicitly
|
|
86
|
+
def children
|
|
87
|
+
math.children
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def to_xml(*args)
|
|
91
|
+
math.to_xml(*args)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def self.from_xml(input)
|
|
95
|
+
parsed = Mml::V3::Math.from_xml(input)
|
|
96
|
+
new(
|
|
97
|
+
id: parsed.id,
|
|
98
|
+
display: parsed.display,
|
|
99
|
+
math: parsed
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Option B: Forwardable Module
|
|
108
|
+
|
|
109
|
+
Use Ruby's `Forwardable` module for cleaner delegation:
|
|
110
|
+
|
|
111
|
+
```ruby
|
|
112
|
+
require 'forwardable'
|
|
113
|
+
|
|
114
|
+
module Sts
|
|
115
|
+
module Mathml
|
|
116
|
+
class Math < Lutaml::Model::Serializable
|
|
117
|
+
extend Forwardable
|
|
118
|
+
|
|
119
|
+
attribute :id, :string
|
|
120
|
+
attribute :display, :string
|
|
121
|
+
attribute :math, Mml::V3::Math
|
|
122
|
+
|
|
123
|
+
def_delegators :math, :children, :to_xml, :to_json
|
|
124
|
+
def_delegators :math, :id=, :display=
|
|
125
|
+
|
|
126
|
+
xml do
|
|
127
|
+
# ... xml mapping
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Verification
|
|
135
|
+
|
|
136
|
+
After fix, ensure:
|
|
137
|
+
1. `bundle exec rubocop lib/sts/mathml.rb` passes with no Style/Send, Style/MethodMissing violations
|
|
138
|
+
2. `bundle exec rspec spec/` round-trip tests pass for MathML content
|
|
139
|
+
3. Reference doc `C070908e.xml` parses and serializes correctly
|
|
140
|
+
|
|
141
|
+
## Dependencies
|
|
142
|
+
|
|
143
|
+
None — can be done independently.
|
|
144
|
+
|
|
145
|
+
## TODO Checklist
|
|
146
|
+
|
|
147
|
+
- [ ] Read current `lib/sts/mathml.rb`
|
|
148
|
+
- [ ] Identify all methods actually called on `Mml::V3::Math` in codebase
|
|
149
|
+
- [ ] Implement Option A or B
|
|
150
|
+
- [ ] Update `lib/sts/mathml.rb`
|
|
151
|
+
- [ ] Verify rubocop: no anti-pattern warnings
|
|
152
|
+
- [ ] Run round-trip tests
|
|
153
|
+
- [ ] Test C070908e.xml specifically
|