Metanorma: Aequitate Verum

mnconvert supports IEC/ISO NISO STS Coding Guidelines 1.0

Author’s picture Ronald Tse Author’s picture Alexander Dyuzhev on 08 Jan 2023

Introduction

IEC and ISO now use the NISO STS XML format in internal workflow processes for publication and distribution to its members.

Metanorma’s mnconvert allows easy conversion from NISO STS XML format into Metanorma, as well as from Metanorma’s Semantic XML format to NISO STS.

mnconvert now supports IEC/ISO STS conversion in accordance with IEC/ISO Coding Guidelines for NISO STS 1.0

IEC or ISO Metanorma XML document determination

mnconvert determines the destination NISO STS XML format - ISO or IEC - by the prefix of the elements in the source Metanorma XML:

  • iso-standard for ISO, and

  • iec-standard for IEC.

id generation rules

  • Foreword section

    • IEC: id="sec-foreword"

    • ISO: id="sec_foreword"

  • Introduction section

    • IEC: id="sec-introduction"

    • ISO: id="sec_intro", "sec_0" if there are sub-clauses

  • Section

    • IEC: id="sec-X(.Y)*",

    • ISO: id="sec_X(.Y)*",

where "X(.Y)*" is the section, clause, subclause number (example, 1.2.1, B.1 for Annex)

  • Annex

    • IEC: id="anx-X",

    • ISO: id="sec_X",

where "X" is the annex letter

  • Bibliography section

    • IEC: id="sec-bibliography"

    • ISO: id="sec_bibl"

  • Bibliography item

    • IEC: id="bib-X"

    • ISO: id="biblref_X",

where "X" is item number

  • Index

    • IEC: id="sec-index"

    • ISO: id="sec_index"

  • Paragraph

    • IEC: id="p-N", where N is the sequential number throughout the document

  • List item

    • IEC: id="lis-X.Y-Ln-M", where "X.Y" is the subclause number, "n" is the list number inside the subclause, "M" is the list item number

For nested list: id="lis-X.Y-Ln-Lk-M", where "k" is the parent list-item number

Note
lists in non-numbered sections (Foreword, Introduction) don’t have id.
  • Table, numbered

    • IEC: id="tab-X",

    • ISO: id="tab_X",

where "X" is the table number

  • Table, without number

    • IEC: id="tab-informal-X.Y-N", where "X.Y" is the subclause number, "N" is the table number in the subclause

    • ISO:` id="tab_X"`, where "X" - any letter

  • Figure, numbered

    • IEC: id="fig-X",

    • ISO: id="fig_X",

where "X" is figure number

  • Note

    • IEC: id="not-X.Y-N", where "X.Y" is the subclause number, "N" is the note number inside the subclause

Note
notes in non-numbered sections (Foreword, Introduction) don’t have id.
  • Table note

    • IEC: id="tno-X-N", where "X" is the table number, "N" is note number inside the table.

  • Figure note

    • IEC: id="fno-X-N", where "X" is the figure number, "N" is note number inside the figure.

  • Term section

    • IEC: id="con-X.Y",

    • ISO: id="sec_X.Y",

where "X.Y" is the term entry number (section number)

  • Term entry

    • IEC: id="te-X.Y",

    • ISO: id="term_X.Y",

where "X.Y" is the term entry number (section number)

  • Term

    • IEC: id="ter-term_without_spaces", where "term_without_spaces" is the term with replaced spaced, non-break space, '(', ')' to underscore

  • Note to entry

    • IEC: id="nte-X.Y-N", where "X.Y" is the subclause number, "N" is the sequential note number for the current term

  • Formula, numbered

    • IEC: id="for-N",

    • ISO: id="formula_N",

where "N" is formula number

  • Formula, without number

    • IEC: id="for-informal-X-Y", where "X" is the subclause number, "Y" is the sequential formula number inside the subclause

  • Math

    • IEC: id="mml-mN", where "N" is the sequential number throughout the document

  • Text footnote

    • IEC: id="foo-N",

    • ISO: id="fn_N",

where "N" is the sequential number throughout the document

  • Table footnote

    • IEC: id="tfn-X-Y",

    • ISO: id="table-fn_X-Y", or id="table-fn_N"

where "X" is the table number, "Y" is the sequential number if the footnote inside the table, "N" is the table footnote sequence within the document

  • Figure footnote

    • IEC: id="figfn-X-Y",

    • ISO: id="figure-fn_X-Y",

where "X" is the figure number, "Y" is the sequential number inside the figure

If url isn’t start with http:, https:, ftp:, mailto:, or link/@target is different than the text in link, then link tagged as ext-link. And otherwise tagged as uri.

EXAMPLE: <link target="https://www.iso.org/obp"/> converts to <uri>https://www.iso.org/obp</uri>;

EXAMPLE: <link target="http://www.iso.org/directives">www.iso.org/directives</link> converts to <ext-link xlink:href="http://www.iso.org/directives">www.iso.org/directives</ext-link>

EXAMPLE: <link target="http://standards.iso.org/iso/10303/tech/step_titles.htm">ISO website</link> converts to <ext-link xlink:href="http://standards.iso.org/iso/10303/tech/step_titles.htm">ISO website</ext-link>

EXAMPLE: <link target="mailto:gehf@vacheequipment.fic"/> converts to <uri>mailto:gehf@vacheequipment.fic</uri></p>

Metadata tag

Now metadata tagged as std-meta for both IEC and ISO documents.

For IEC documents mnconvert generates a few permissions for each copyright/owner/organization in the Metanorma XML.

'sec-type' determination

mnconvert expanded for the determination of sec-type by titles:

sec-type Title

foreword

Foreword, Avant-propos, Prólogo / Prólogo de la versión en español, Предисловие

intro

Introduction, Introducción, Введение

scope

Scope, Domaine d’application, Objeto y campo de aplicación, Область применения

norm-refs

Normative references, Références normatives, Referencias normativas, Нормативные ссылки

terms

Terms and definitions / starts with 'Terms, definitions', Termes et definitions / starts with 'Termes, définitions;, Тérminos y definiciones, Термины и определения

'content-type' for Annex

mnconvert adds @content-type and <annex-type> in accordance with the rules:

  • ISO:

    • @content-type="inform-annex, <annex-type>(informative)</annex-type> for informative Annex

    • @content-type="normative-annex", <annex-type>(normative)</annex-type> for normative Annex

  • IEC:

    • @content-type="informative for informative Annex

    • @content-type="normative" for normative Annex

If title starts with This annex does not form an integral part `, then `@content-type isn’t added.

IEC index support

mnconverts converts indexes in IEC documents into the structure:

<index-entry id="df-1">
	<term>ambient air temperature</term>
	<see-entry>3.8.9</see-entry>
	<see-entry>df 1</see-entry>
</index-entry>

Warning, Important and Caution support

mnconvert transforms the Metanorma element admonition into NISO STS XML element non-normative-note with @content-type=”warning”, “important” or “caution”.

List in paragraph processing

mnconvert encodes lists outside of the preceding paragraph, always for IEC and ISO.

<p>There may be a variety of reasons for a... These include the following:</p>
<list list-type="dash">
  <list-item>
    <label>—</label>
    <p>genuine differences in performance between laboratories;</p>

Abbreviation list determination

mnconvert recognizes abbreviation list if:

  • preceding title contains the substring 'Abbrev'

or

  • definition term @id starts with the prefix abb- or abb_

and sets the attribute @list-type="abbreviation".

Part of speech support

mnconvert now supports tbx:partOfSpeech conversion.

Metanorma XML example:

<preferred><expression>
<name>date and time representation</name>
<grammar><isAdjective>true</isAdjective></grammar></expression>
</preferred>

Output NISO STS XML example:

<tbx:term>date and time representation</tbx:term>
<tbx:partOfSpeech value="adj"/>

Forms of the term support

mnconvert supports these forms of the term:

  • acronym

  • abbreviation

  • fullForm

  • symbol

The support for:

  • formula

  • equation

will be added later.

'See' note support

mnconvert updated for tbx:see processing. Now mnconvert:

  • generates NOTE in adoc for the element tbx:see, and adds prefix See `and suffix `for more information. (prefix and suffix support in en, fr and ru languages, see below).

NISO STS XML:

<tbx:see target="sec_A"/>

converts to Metanorma Adoc:

NOTE: See <<sec_A>> for more information.
  • generates tbx:see in Metanorma XML to NISO STS XML conversion for termnote with the prefix See `and suffix `for more information. (prefix and suffix support in en, fr and ru languages, see below).

Metanorma XML:

<termnote id="_">
<p id="_">See <xref target="sec_A"/> for more information.</p>
</termnote>

converts to NISO STS XML:

<tbx:see target="sec_A"/>

Supported strings for prefix:

en

See

fr

Voir

ru

См.

Supported strings for suffix:

en

for more information.

fr

pour plus d’informations.

ru

для дополнительной информации.

Refined support for tbx:source

mnconvert generates tbx:source for ISO documents without std inside.

Before:

<tbx:source>
<std type="dated">
<std-ref>ISO 7301:2011</std-ref>, Clause 3.1</std>
</tbx:source>

After:

<tbx:source>ISO 7301:2011, Clause 3.1</tbx:source>

Subject field support

mnconvert now converts the NISO STS XML element tbx:subjectField into

Metanorma Adoc

domain:[dispute resolution]

and

Metanorma XML:

<domain>dispute resolution</domain>

into NISO STS XML

<tbx:subjectField>dispute resolution</tbx:subjectField>

Refined support for @ref-type in xref

mnconvert supports the values xref/@ref-type:

  • app,

  • bibr,

  • disp-formula,

  • fig,

  • fn,

  • list,

  • sec,

  • table,

  • table-fn,

  • other.

Refined processing of sup

The tag <sup> around footnote number removed for IEC documents.

Figure key support

mnconvert encodes the figure key as:

ISO

fig/table-wrap/table with an attribute @content-type="fig-index".

IEC

fig/def-list with an attribute @list-content="figure".

Refined processing of table header cell format

mnconvert updated for Metanorma XML to NISO STS XML conversion of ISO documents — table header cell’s text enclosed now in the bold element.

Table width processing

table/@width processing removed for IEC document.

Conclusion

Questions or suggestions, please feel free to file an issue at the mnconvert repo at GitHub!