metanorma-itu 2.5.4 → 2.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/itu/base_convert.rb +1 -1
  3. data/lib/isodoc/itu/cleanup.rb +1 -1
  4. data/lib/isodoc/itu/html_convert.rb +1 -1
  5. data/lib/isodoc/itu/i18n.rb +1 -1
  6. data/lib/isodoc/itu/init.rb +2 -2
  7. data/lib/isodoc/itu/itu.implementers-guide.xsl +85 -22
  8. data/lib/isodoc/itu/itu.in-force.xsl +85 -22
  9. data/lib/isodoc/itu/itu.recommendation-annex.xsl +85 -22
  10. data/lib/isodoc/itu/itu.recommendation-supplement.xsl +85 -22
  11. data/lib/isodoc/itu/itu.recommendation.xsl +85 -22
  12. data/lib/isodoc/itu/itu.resolution.xsl +85 -22
  13. data/lib/isodoc/itu/itu.service-publication.xsl +85 -22
  14. data/lib/isodoc/itu/itu.technical-paper.xsl +85 -22
  15. data/lib/isodoc/itu/itu.technical-report.xsl +85 -22
  16. data/lib/isodoc/itu/metadata.rb +2 -2
  17. data/lib/isodoc/itu/metadata_date.rb +1 -1
  18. data/lib/isodoc/itu/pdf_convert.rb +1 -1
  19. data/lib/isodoc/itu/presentation_bibdata.rb +1 -1
  20. data/lib/isodoc/itu/presentation_contribution.rb +1 -1
  21. data/lib/isodoc/itu/presentation_preface.rb +1 -1
  22. data/lib/isodoc/itu/presentation_ref.rb +1 -1
  23. data/lib/isodoc/itu/presentation_xml_convert.rb +1 -1
  24. data/lib/isodoc/itu/ref.rb +1 -1
  25. data/lib/isodoc/itu/terms.rb +1 -1
  26. data/lib/isodoc/itu/word_cleanup.rb +1 -1
  27. data/lib/isodoc/itu/word_convert.rb +1 -1
  28. data/lib/isodoc/itu/xref.rb +1 -1
  29. data/lib/isodoc/itu/xref_section.rb +1 -1
  30. data/lib/isodoc/itu.rb +1 -1
  31. data/lib/metanorma/itu/biblio-standoc.rng +13 -0
  32. data/lib/metanorma/itu/biblio.rng +19 -12
  33. data/lib/metanorma/itu/cleanup.rb +1 -1
  34. data/lib/metanorma/itu/cleanup_section.rb +1 -1
  35. data/lib/metanorma/itu/converter.rb +6 -6
  36. data/lib/metanorma/itu/front.rb +2 -1
  37. data/lib/metanorma/itu/front_id.rb +1 -1
  38. data/lib/metanorma/itu/processor.rb +6 -6
  39. data/lib/metanorma/itu/relaton-itu.rng +1 -0
  40. data/lib/metanorma/itu/validate.rb +1 -1
  41. data/lib/metanorma/itu/version.rb +2 -2
  42. data/lib/metanorma/itu.rb +1 -1
  43. data/lib/metanorma-itu.rb +1 -1
  44. data/lib/relaton/render/general.rb +2 -2
  45. data/lib/relaton/render/parse.rb +1 -1
  46. data/metanorma-itu.gemspec +1 -1
  47. metadata +2 -2
@@ -6131,7 +6131,8 @@
6131
6131
  </xsl:choose>
6132
6132
  </xsl:variable>
6133
6133
  <xsl:variable name="current_fn_number_text">
6134
- <xsl:value-of select="$current_fn_number"/>
6134
+
6135
+ <xsl:value-of select="$current_fn_number"/>
6135
6136
 
6136
6137
  </xsl:variable>
6137
6138
 
@@ -6167,8 +6168,10 @@
6167
6168
 
6168
6169
  <xsl:call-template name="insert_basic_link">
6169
6170
  <xsl:with-param name="element">
6170
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
6171
- <xsl:copy-of select="$current_fn_number_text"/>
6171
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
6172
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
6173
+ <xsl:copy-of select="$current_fn_number_text"/>
6174
+ </fo:inline>
6172
6175
  </fo:basic-link>
6173
6176
  </xsl:with-param>
6174
6177
  </xsl:call-template>
@@ -6455,7 +6458,7 @@
6455
6458
 
6456
6459
  <xsl:call-template name="refine_fn-reference-style"/>
6457
6460
 
6458
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
6461
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
6459
6462
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
6460
6463
  <xsl:attribute name="internal-destination">
6461
6464
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -7499,9 +7502,19 @@
7499
7502
  </fo:inline>
7500
7503
  </xsl:template>
7501
7504
 
7502
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
7505
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
7506
+ <xsl:param name="txt"/>
7503
7507
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
7504
- <xsl:variable name="text" select="."/>
7508
+ <xsl:variable name="text">
7509
+ <xsl:choose>
7510
+ <xsl:when test="$txt != ''">
7511
+ <xsl:value-of select="$txt"/>
7512
+ </xsl:when>
7513
+ <xsl:otherwise>
7514
+ <xsl:value-of select="."/>
7515
+ </xsl:otherwise>
7516
+ </xsl:choose>
7517
+ </xsl:variable>
7505
7518
  <xsl:variable name="ratio_">
7506
7519
  0.75
7507
7520
  </xsl:variable>
@@ -8947,9 +8960,12 @@
8947
8960
  <xsl:apply-templates/>
8948
8961
  </xsl:when>
8949
8962
  <xsl:otherwise>
8963
+ <xsl:variable name="alt_text">
8964
+ <xsl:call-template name="getAltText"/>
8965
+ </xsl:variable>
8950
8966
  <xsl:call-template name="insert_basic_link">
8951
8967
  <xsl:with-param name="element">
8952
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8968
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
8953
8969
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8954
8970
  <xsl:attribute name="role">Annot</xsl:attribute>
8955
8971
  </xsl:if>
@@ -8976,6 +8992,14 @@
8976
8992
  </fo:inline>
8977
8993
  </xsl:template> <!-- link -->
8978
8994
 
8995
+ <xsl:template name="getAltText">
8996
+ <xsl:choose>
8997
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
8998
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
8999
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
9000
+ </xsl:choose>
9001
+ </xsl:template>
9002
+
8979
9003
  <!-- ======================== -->
8980
9004
  <!-- Appendix processing -->
8981
9005
  <!-- ======================== -->
@@ -9006,7 +9030,7 @@
9006
9030
  <xsl:template match="*[local-name() = 'callout']">
9007
9031
  <xsl:choose>
9008
9032
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
9009
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
9033
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
9010
9034
  </xsl:choose>
9011
9035
  </xsl:template>
9012
9036
 
@@ -9035,7 +9059,10 @@
9035
9059
  <xsl:template match="*[local-name() = 'xref']">
9036
9060
  <xsl:call-template name="insert_basic_link">
9037
9061
  <xsl:with-param name="element">
9038
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
9062
+ <xsl:variable name="alt_text">
9063
+ <xsl:call-template name="getAltText"/>
9064
+ </xsl:variable>
9065
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
9039
9066
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
9040
9067
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9041
9068
  </xsl:if>
@@ -11523,12 +11550,14 @@
11523
11550
 
11524
11551
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
11525
11552
 
11526
- <xsl:variable name="provisional_distance_between_starts">
11553
+ <xsl:variable name="provisional_distance_between_starts_">
11527
11554
  7
11528
11555
  </xsl:variable>
11529
- <xsl:variable name="indent">
11556
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
11557
+ <xsl:variable name="indent_">
11530
11558
  0
11531
11559
  </xsl:variable>
11560
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
11532
11561
 
11533
11562
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
11534
11563
  <fo:list-item>
@@ -12260,14 +12289,17 @@
12260
12289
  </xsl:when>
12261
12290
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
12262
12291
 
12263
- <xsl:variable name="label">
12292
+ <xsl:variable name="type" select="../@type"/>
12264
12293
 
12265
- <xsl:variable name="type" select="../@type"/>
12294
+ <xsl:variable name="label">
12266
12295
 
12267
12296
  <xsl:variable name="style_prefix_">
12268
12297
  <xsl:if test="$type = 'roman'">
12269
12298
  <!-- Example: (i) -->
12270
12299
  </xsl:if>
12300
+ <xsl:if test="$type = 'alphabet'">
12301
+
12302
+ </xsl:if>
12271
12303
  </xsl:variable>
12272
12304
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
12273
12305
 
@@ -12293,13 +12325,15 @@
12293
12325
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
12294
12326
  <xsl:value-of select="$style_prefix"/>
12295
12327
  </xsl:if>
12328
+
12296
12329
  <xsl:value-of select="@label"/>
12330
+
12297
12331
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
12298
12332
  <xsl:value-of select="$style_suffix"/>
12299
12333
  </xsl:if>
12300
12334
  </xsl:variable>
12301
12335
 
12302
- <xsl:value-of select="normalize-space($label)"/>
12336
+ <xsl:value-of select="normalize-space($label)"/>
12303
12337
 
12304
12338
  </xsl:when>
12305
12339
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -14525,7 +14559,8 @@
14525
14559
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
14526
14560
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
14527
14561
  <!-- Todo: need update -->
14528
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
14562
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
14563
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
14529
14564
 
14530
14565
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
14531
14566
  <xsl:attribute name="src">
@@ -14546,6 +14581,9 @@
14546
14581
  <xsl:if test="$afrelationship != ''">
14547
14582
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14548
14583
  </xsl:if>
14584
+ <xsl:if test="$volatile != ''">
14585
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
14586
+ </xsl:if>
14549
14587
  </pdf:embedded-file>
14550
14588
  </xsl:for-each>
14551
14589
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -14556,14 +14594,18 @@
14556
14594
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
14557
14595
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
14558
14596
  <!-- Todo: need update -->
14559
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
14597
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
14598
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
14560
14599
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
14561
14600
  <xsl:if test="$description != ''">
14562
14601
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
14563
14602
  </xsl:if>
14564
14603
  <xsl:if test="$afrelationship != ''">
14565
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14566
- </xsl:if>
14604
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
14605
+ </xsl:if>
14606
+ <xsl:if test="$volatile != ''">
14607
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
14608
+ </xsl:if>
14567
14609
  </pdf:embedded-file>
14568
14610
  </xsl:for-each>
14569
14611
  </xsl:if>
@@ -14610,10 +14652,31 @@
14610
14652
  <xsl:value-of select="$level_total - 2"/>
14611
14653
  </xsl:when>
14612
14654
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
14613
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
14655
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
14656
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
14657
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
14658
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
14659
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
14660
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
14661
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
14662
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
14663
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
14664
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
14665
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
14614
14666
  <xsl:choose>
14615
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
14616
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
14667
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
14668
+ <xsl:value-of select="number($curr_clause_depth)"/>
14669
+ </xsl:when>
14670
+ <xsl:otherwise>
14671
+ <xsl:value-of select="$level_total - 2"/>
14672
+ </xsl:otherwise>
14673
+ </xsl:choose>
14674
+ </xsl:when>
14675
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
14676
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
14677
+ <xsl:choose>
14678
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
14679
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
14617
14680
  </xsl:when>
14618
14681
  <xsl:otherwise>
14619
14682
  <xsl:value-of select="$level_total - 2"/>
@@ -14621,7 +14684,7 @@
14621
14684
  </xsl:choose>
14622
14685
  </xsl:when>
14623
14686
  <xsl:when test="ancestor::*[local-name() = 'sections']">
14624
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
14687
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
14625
14688
  <xsl:choose>
14626
14689
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
14627
14690
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -2,7 +2,7 @@ require "twitter_cldr"
2
2
  require_relative "metadata_date"
3
3
 
4
4
  module IsoDoc
5
- module ITU
5
+ module Itu
6
6
  class Metadata < IsoDoc::Metadata
7
7
  def initialize(lang, script, locale, labels)
8
8
  super
@@ -12,7 +12,7 @@ module IsoDoc
12
12
  set(:logo_word, fileloc(n))
13
13
  set(:logo_sp, fileloc("logo-sp.png"))
14
14
  set(:logo_small, fileloc("logo-small.png"))
15
- @isodoc = IsoDoc::ITU::HtmlConvert.new({})
15
+ @isodoc = IsoDoc::Itu::HtmlConvert.new({})
16
16
  end
17
17
 
18
18
  def fileloc(file)
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module ITU
2
+ module Itu
3
3
  class Metadata < IsoDoc::Metadata
4
4
  def monthyr(isodate)
5
5
  m = /(?<yr>\d\d\d\d)-(?<mo>\d\d)/.match isodate
@@ -2,7 +2,7 @@ require "isodoc"
2
2
  require "fileutils"
3
3
 
4
4
  module IsoDoc
5
- module ITU
5
+ module Itu
6
6
  # A {Converter} implementation that generates PDF HTML output, and a
7
7
  # document schema encapsulation of the document for validation
8
8
  class PdfConvert < IsoDoc::XslfoPdfConvert
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module ITU
2
+ module Itu
3
3
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
4
4
  def bibdata_i18n(bib)
5
5
  super
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module ITU
2
+ module Itu
3
3
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
4
4
  def contribution_table_insert_pt(docxml)
5
5
  docxml.at(ns("//preface")) || docxml.at(ns("//sections"))
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module ITU
2
+ module Itu
3
3
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
4
4
  def insert_preface_sections(docxml)
5
5
  if @doctype == "contribution"
@@ -6,7 +6,7 @@ require_relative "presentation_bibdata"
6
6
  require_relative "presentation_preface"
7
7
 
8
8
  module IsoDoc
9
- module ITU
9
+ module Itu
10
10
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
11
11
  def bibrender_formattedref(formattedref, _xml)
12
12
  formattedref << "." unless /\.$/.match?(formattedref.text)
@@ -19,7 +19,7 @@ module Nokogiri
19
19
  end
20
20
 
21
21
  module IsoDoc
22
- module ITU
22
+ module Itu
23
23
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
24
24
  def initialize(options)
25
25
  @hierarchical_assets = options[:hierarchicalassets]
@@ -3,7 +3,7 @@ require_relative "metadata"
3
3
  require "fileutils"
4
4
 
5
5
  module IsoDoc
6
- module ITU
6
+ module Itu
7
7
  module BaseConvert
8
8
  def nonstd_bibitem(list, bibitem, _ordinal, biblio)
9
9
  list.tr **attr_code(iso_bibitem_entry_attrs(bibitem, biblio)) do |ref|
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module ITU
2
+ module Itu
3
3
  module BaseConvert
4
4
  def termdef_parse1(node, div, defn, source)
5
5
  div.p **{ class: "TermNum", id: node["id"] } do |p|
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module ITU
2
+ module Itu
3
3
  class WordConvert < IsoDoc::WordConvert
4
4
  def word_preface_cleanup(docxml)
5
5
  docxml.xpath("//h1[@class = 'AbstractTitle'] | "\
@@ -4,7 +4,7 @@ require_relative "word_cleanup"
4
4
  require "fileutils"
5
5
 
6
6
  module IsoDoc
7
- module ITU
7
+ module Itu
8
8
  class WordConvert < IsoDoc::WordConvert
9
9
  def initialize(options)
10
10
  @libdir = File.dirname(__FILE__)
@@ -3,7 +3,7 @@ require "fileutils"
3
3
  require_relative "xref_section"
4
4
 
5
5
  module IsoDoc
6
- module ITU
6
+ module Itu
7
7
  class Counter < IsoDoc::XrefGen::Counter
8
8
  def print
9
9
  ret = super or return nil
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module ITU
2
+ module Itu
3
3
  class Xref < IsoDoc::Xref
4
4
  def clause_order_annex(docxml)
5
5
  if docxml.at(ns("//bibdata/ext/structuredidentifier/annexid"))
data/lib/isodoc/itu.rb CHANGED
@@ -6,6 +6,6 @@ require "isodoc/itu/word_convert"
6
6
  require "isodoc/itu/presentation_xml_convert"
7
7
 
8
8
  module IsoDoc
9
- module ITU
9
+ module Itu
10
10
  end
11
11
  end
@@ -72,6 +72,9 @@ standards defining organization, and that is rendered in a distinct manner</a:do
72
72
  from other documents in the same doctype</a:documentation>
73
73
  </ref>
74
74
  </optional>
75
+ <ref name="flavor">
76
+ <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
77
+ </ref>
75
78
  <optional>
76
79
  <ref name="editorialgroup">
77
80
  <a:documentation>Groups associated with the production of the standards document, typically within
@@ -113,6 +116,16 @@ a standards definition organization</a:documentation>
113
116
  <define name="DocumentSubtype">
114
117
  <text/>
115
118
  </define>
119
+ <define name="flavor">
120
+ <element name="flavor">
121
+ <ref name="MetanormaFlavor"/>
122
+ </element>
123
+ </define>
124
+ <define name="MetanormaFlavor">
125
+ <a:documentation>This is in fact an enum, as of this writing: standoc iso generic ietf ieee itu nist ogc csa cc iho ribose jis iec bsi bipm plateau.
126
+ However we prefer not to hardcode it, given ongoing extension.</a:documentation>
127
+ <text/>
128
+ </define>
116
129
  <define name="editorialgroup">
117
130
  <a:documentation>A group associated with the production of the standards document, typically within
118
131
  a standards definition organization</a:documentation>
@@ -1382,18 +1382,7 @@ Applies whether the resource has already been created or not, and whether it is
1382
1382
  <define name="bdate">
1383
1383
  <a:documentation>Significant date in the lifecycle of the bibliographic item, including its production and its access</a:documentation>
1384
1384
  <element name="date">
1385
- <attribute name="type">
1386
- <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1387
- <choice>
1388
- <ref name="BibliographicDateType"/>
1389
- <text/>
1390
- </choice>
1391
- </attribute>
1392
- <optional>
1393
- <attribute name="text">
1394
- <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1395
- </attribute>
1396
- </optional>
1385
+ <ref name="bDateAttributes"/>
1397
1386
  <optional>
1398
1387
  <choice>
1399
1388
  <group>
@@ -1416,6 +1405,20 @@ Applies whether the resource has already been created or not, and whether it is
1416
1405
  </optional>
1417
1406
  </element>
1418
1407
  </define>
1408
+ <define name="bDateAttributes">
1409
+ <attribute name="type">
1410
+ <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1411
+ <choice>
1412
+ <ref name="BibliographicDateType"/>
1413
+ <text/>
1414
+ </choice>
1415
+ </attribute>
1416
+ <optional>
1417
+ <attribute name="text">
1418
+ <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1419
+ </attribute>
1420
+ </optional>
1421
+ </define>
1419
1422
  <define name="docidentifier">
1420
1423
  <a:documentation>An identifier of a bibliographic item in an international standard scheme</a:documentation>
1421
1424
  <element name="docidentifier">
@@ -1884,6 +1887,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1884
1887
  <value>hasAnnotation</value>
1885
1888
  <value>draftOf</value>
1886
1889
  <value>hasDraft</value>
1890
+ <value>preliminaryDraftOf</value>
1891
+ <value>hasPreliminaryDraft</value>
1892
+ <value>revisionDraftOf</value>
1893
+ <value>hasRevisionDraft</value>
1887
1894
  <value>editionOf</value>
1888
1895
  <value>hasEdition</value>
1889
1896
  <value>updates</value>
@@ -1,7 +1,7 @@
1
1
  require_relative "cleanup_section"
2
2
 
3
3
  module Metanorma
4
- module ITU
4
+ module Itu
5
5
  class Converter < Standoc::Converter
6
6
  def table_cleanup(xmldoc)
7
7
  super
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
- module ITU
2
+ module Itu
3
3
  class Converter < Standoc::Converter
4
4
  def sections_cleanup(xml)
5
5
  super
@@ -7,7 +7,7 @@ require_relative "./validate"
7
7
  require_relative "./cleanup"
8
8
 
9
9
  module Metanorma
10
- module ITU
10
+ module Itu
11
11
  class Converter < Standoc::Converter
12
12
  XML_ROOT_TAG = "itu-standard".freeze
13
13
  XML_NAMESPACE = "https://www.metanorma.org/ns/itu".freeze
@@ -140,22 +140,22 @@ module Metanorma
140
140
  end
141
141
 
142
142
  def presentation_xml_converter(node)
143
- IsoDoc::ITU::PresentationXMLConvert
143
+ IsoDoc::Itu::PresentationXMLConvert
144
144
  .new(html_extract_attributes(node)
145
- .merge(output_formats: ::Metanorma::ITU::Processor.new
145
+ .merge(output_formats: ::Metanorma::Itu::Processor.new
146
146
  .output_formats))
147
147
  end
148
148
 
149
149
  def html_converter(node)
150
- IsoDoc::ITU::HtmlConvert.new(html_extract_attributes(node))
150
+ IsoDoc::Itu::HtmlConvert.new(html_extract_attributes(node))
151
151
  end
152
152
 
153
153
  def pdf_converter(node)
154
- IsoDoc::ITU::PdfConvert.new(pdf_extract_attributes(node))
154
+ IsoDoc::Itu::PdfConvert.new(pdf_extract_attributes(node))
155
155
  end
156
156
 
157
157
  def doc_converter(node)
158
- IsoDoc::ITU::WordConvert.new(doc_extract_attributes(node))
158
+ IsoDoc::Itu::WordConvert.new(doc_extract_attributes(node))
159
159
  end
160
160
  end
161
161
  end
@@ -2,7 +2,7 @@ require "fileutils"
2
2
  require_relative "./front_id"
3
3
 
4
4
  module Metanorma
5
- module ITU
5
+ module Itu
6
6
  class Converter < Standoc::Converter
7
7
  def metadata_status(node, xml)
8
8
  stage = node.attr("status") || node.attr("docstage") || "published"
@@ -228,6 +228,7 @@ module Metanorma
228
228
  def metadata_ext(node, xml)
229
229
  metadata_doctype(node, xml)
230
230
  metadata_subdoctype(node, xml)
231
+ metadata_flavor(node, xml)
231
232
  metadata_committee(node, xml)
232
233
  metadata_ics(node, xml)
233
234
  metadata_recommendationstatus(node, xml)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
- module ITU
2
+ module Itu
3
3
  class Converter < Standoc::Converter
4
4
  def metadata_id(node, xml)
5
5
  provisional_id(node, xml)
@@ -1,7 +1,7 @@
1
1
  require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
- module ITU
4
+ module Itu
5
5
  class Processor < Metanorma::Processor
6
6
 
7
7
  def initialize
@@ -30,23 +30,23 @@ module Metanorma
30
30
  end
31
31
 
32
32
  def version
33
- "Metanorma::ITU #{Metanorma::ITU::VERSION}"
33
+ "Metanorma::Itu #{Metanorma::Itu::VERSION}"
34
34
  end
35
35
 
36
36
  def output(isodoc_node, inname, outname, format, options={})
37
37
  options_preprocess(options)
38
38
  case format
39
39
  when :html
40
- IsoDoc::ITU::HtmlConvert.new(options).convert(inname, isodoc_node,
40
+ IsoDoc::Itu::HtmlConvert.new(options).convert(inname, isodoc_node,
41
41
  nil, outname)
42
42
  when :doc
43
- IsoDoc::ITU::WordConvert.new(options).convert(inname, isodoc_node,
43
+ IsoDoc::Itu::WordConvert.new(options).convert(inname, isodoc_node,
44
44
  nil, outname)
45
45
  when :pdf
46
- IsoDoc::ITU::PdfConvert.new(options).convert(inname, isodoc_node,
46
+ IsoDoc::Itu::PdfConvert.new(options).convert(inname, isodoc_node,
47
47
  nil, outname)
48
48
  when :presentation
49
- IsoDoc::ITU::PresentationXMLConvert.new(options).convert(
49
+ IsoDoc::Itu::PresentationXMLConvert.new(options).convert(
50
50
  inname, isodoc_node, nil, outname)
51
51
  else
52
52
  super
@@ -70,6 +70,7 @@
70
70
  <optional>
71
71
  <ref name="docsubtype"/>
72
72
  </optional>
73
+ <ref name="flavor"/>
73
74
  <oneOrMore>
74
75
  <ref name="editorialgroup"/>
75
76
  </oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
- module ITU
2
+ module Itu
3
3
  class Converter < Standoc::Converter
4
4
  def bibdata_validate(doc)
5
5
  doctype_validate(doc)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
- module ITU
3
- VERSION = "2.5.4".freeze
2
+ module Itu
3
+ VERSION = "2.5.5".freeze
4
4
  end
5
5
  end
data/lib/metanorma/itu.rb CHANGED
@@ -3,7 +3,7 @@ require "metanorma/itu/processor"
3
3
  require "metanorma/itu/converter"
4
4
 
5
5
  module Metanorma
6
- module ITU
6
+ module Itu
7
7
  ORGANIZATION_NAME_SHORT = "ITU"
8
8
  ORGANIZATION_NAME_LONG = "International Telecommunication Union"
9
9
  end
data/lib/metanorma-itu.rb CHANGED
@@ -4,5 +4,5 @@ require "isodoc/itu"
4
4
  require "metanorma"
5
5
 
6
6
  if defined? Metanorma::Registry
7
- Metanorma::Registry.instance.register(Metanorma::ITU::Processor)
7
+ Metanorma::Registry.instance.register(Metanorma::Itu::Processor)
8
8
  end