metanorma-ieee 1.3.1 → 1.3.3

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/html2doc/ieee/lists.rb +1 -1
  3. data/lib/html2doc/ieee/notes.rb +1 -1
  4. data/lib/html2doc/ieee.rb +1 -1
  5. data/lib/html2doc/ieee_wp/lists.rb +1 -1
  6. data/lib/html2doc/ieee_wp.rb +1 -1
  7. data/lib/isodoc/ieee/base_convert.rb +1 -1
  8. data/lib/isodoc/ieee/html_convert.rb +1 -1
  9. data/lib/isodoc/ieee/i18n.rb +1 -1
  10. data/lib/isodoc/ieee/ieee.amendment.xsl +139 -52
  11. data/lib/isodoc/ieee/ieee.rb +1 -1
  12. data/lib/isodoc/ieee/ieee.standard.xsl +139 -52
  13. data/lib/isodoc/ieee/ieee_xml_convert.rb +2 -2
  14. data/lib/isodoc/ieee/init.rb +2 -2
  15. data/lib/isodoc/ieee/metadata.rb +1 -1
  16. data/lib/isodoc/ieee/pdf_convert.rb +1 -1
  17. data/lib/isodoc/ieee/presentation_bibdata.rb +1 -1
  18. data/lib/isodoc/ieee/presentation_ref.rb +7 -8
  19. data/lib/isodoc/ieee/presentation_terms.rb +1 -1
  20. data/lib/isodoc/ieee/presentation_xml_convert.rb +1 -1
  21. data/lib/isodoc/ieee/word_authority.rb +1 -1
  22. data/lib/isodoc/ieee/word_cleanup.rb +2 -2
  23. data/lib/isodoc/ieee/word_cleanup_blocks.rb +1 -1
  24. data/lib/isodoc/ieee/word_convert.rb +2 -2
  25. data/lib/isodoc/ieee/word_wp_cleanup.rb +2 -2
  26. data/lib/isodoc/ieee/word_wp_convert.rb +1 -1
  27. data/lib/isodoc/ieee/xref.rb +1 -1
  28. data/lib/isodoc/ieee.rb +1 -1
  29. data/lib/metanorma/ieee/biblio-standoc.rng +13 -0
  30. data/lib/metanorma/ieee/biblio.rng +19 -12
  31. data/lib/metanorma/ieee/cleanup.rb +2 -2
  32. data/lib/metanorma/ieee/cleanup_ref.rb +2 -2
  33. data/lib/metanorma/ieee/converter.rb +7 -7
  34. data/lib/metanorma/ieee/front.rb +1 -1
  35. data/lib/metanorma/ieee/processor.rb +7 -7
  36. data/lib/metanorma/ieee/relaton-ieee.rng +1 -0
  37. data/lib/metanorma/ieee/term_lookup_cleanup.rb +1 -1
  38. data/lib/metanorma/ieee/validate.rb +4 -4
  39. data/lib/metanorma/ieee/validate_section.rb +1 -1
  40. data/lib/metanorma/ieee/validate_style.rb +1 -1
  41. data/lib/metanorma/ieee/version.rb +2 -2
  42. data/lib/metanorma/ieee.rb +1 -1
  43. data/lib/metanorma-ieee.rb +1 -1
  44. data/lib/relaton/render/general.rb +2 -2
  45. data/lib/relaton/render/parse.rb +1 -1
  46. data/metanorma-ieee.gemspec +1 -1
  47. metadata +2 -2
@@ -6697,6 +6697,7 @@
6697
6697
  </xsl:if>
6698
6698
 
6699
6699
  <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
6700
+
6700
6701
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
6701
6702
  <xsl:with-param name="continued">true</xsl:with-param>
6702
6703
  </xsl:apply-templates>
@@ -7214,7 +7215,8 @@
7214
7215
  </xsl:choose>
7215
7216
  </xsl:variable>
7216
7217
  <xsl:variable name="current_fn_number_text">
7217
- <xsl:value-of select="$current_fn_number"/>
7218
+
7219
+ <xsl:value-of select="$current_fn_number"/>
7218
7220
 
7219
7221
  </xsl:variable>
7220
7222
 
@@ -7232,10 +7234,14 @@
7232
7234
  <xsl:variable name="fn_styles">
7233
7235
  <xsl:choose>
7234
7236
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
7235
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
7237
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
7238
+
7239
+ </fn_styles>
7236
7240
  </xsl:when>
7237
7241
  <xsl:otherwise>
7238
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
7242
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
7243
+
7244
+ </fn_styles>
7239
7245
  </xsl:otherwise>
7240
7246
  </xsl:choose>
7241
7247
  </xsl:variable>
@@ -7250,8 +7256,10 @@
7250
7256
 
7251
7257
  <xsl:call-template name="insert_basic_link">
7252
7258
  <xsl:with-param name="element">
7253
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
7254
- <xsl:copy-of select="$current_fn_number_text"/>
7259
+ <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 -->
7260
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
7261
+ <xsl:copy-of select="$current_fn_number_text"/>
7262
+ </fo:inline>
7255
7263
  </fo:basic-link>
7256
7264
  </xsl:with-param>
7257
7265
  </xsl:call-template>
@@ -7532,7 +7540,7 @@
7532
7540
 
7533
7541
  <xsl:call-template name="refine_fn-reference-style"/>
7534
7542
 
7535
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
7543
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
7536
7544
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
7537
7545
  <xsl:attribute name="internal-destination">
7538
7546
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -8530,9 +8538,19 @@
8530
8538
  </fo:inline>
8531
8539
  </xsl:template>
8532
8540
 
8533
- <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="text()[ancestor::*[local-name()='smallcap']]">
8541
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
8542
+ <xsl:param name="txt"/>
8534
8543
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
8535
- <xsl:variable name="text" select="."/>
8544
+ <xsl:variable name="text">
8545
+ <xsl:choose>
8546
+ <xsl:when test="$txt != ''">
8547
+ <xsl:value-of select="$txt"/>
8548
+ </xsl:when>
8549
+ <xsl:otherwise>
8550
+ <xsl:value-of select="."/>
8551
+ </xsl:otherwise>
8552
+ </xsl:choose>
8553
+ </xsl:variable>
8536
8554
  <xsl:variable name="ratio_">
8537
8555
  0.75
8538
8556
  </xsl:variable>
@@ -9980,9 +9998,12 @@
9980
9998
  <xsl:apply-templates/>
9981
9999
  </xsl:when>
9982
10000
  <xsl:otherwise>
10001
+ <xsl:variable name="alt_text">
10002
+ <xsl:call-template name="getAltText"/>
10003
+ </xsl:variable>
9983
10004
  <xsl:call-template name="insert_basic_link">
9984
10005
  <xsl:with-param name="element">
9985
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
10006
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
9986
10007
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
9987
10008
  <xsl:attribute name="role">Annot</xsl:attribute>
9988
10009
  </xsl:if>
@@ -10009,6 +10030,14 @@
10009
10030
  </fo:inline>
10010
10031
  </xsl:template> <!-- link -->
10011
10032
 
10033
+ <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="getAltText">
10034
+ <xsl:choose>
10035
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
10036
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
10037
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
10038
+ </xsl:choose>
10039
+ </xsl:template>
10040
+
10012
10041
  <!-- ======================== -->
10013
10042
  <!-- Appendix processing -->
10014
10043
  <!-- ======================== -->
@@ -10039,7 +10068,7 @@
10039
10068
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'callout']">
10040
10069
  <xsl:choose>
10041
10070
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
10042
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
10071
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
10043
10072
  </xsl:choose>
10044
10073
  </xsl:template>
10045
10074
 
@@ -10068,10 +10097,14 @@
10068
10097
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'xref']">
10069
10098
  <xsl:call-template name="insert_basic_link">
10070
10099
  <xsl:with-param name="element">
10071
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
10100
+ <xsl:variable name="alt_text">
10101
+ <xsl:call-template name="getAltText"/>
10102
+ </xsl:variable>
10103
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
10072
10104
  <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'])">
10073
10105
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10074
10106
  </xsl:if>
10107
+
10075
10108
  <xsl:if test="parent::*[local-name() = 'add']">
10076
10109
  <xsl:call-template name="append_add-style"/>
10077
10110
  </xsl:if>
@@ -10180,44 +10213,44 @@
10180
10213
 
10181
10214
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'note']" name="note">
10182
10215
 
10183
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
10216
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
10184
10217
 
10185
- <xsl:call-template name="setBlockSpanAll"/>
10218
+ <xsl:call-template name="setBlockSpanAll"/>
10186
10219
 
10187
- <xsl:call-template name="refine_note-style"/>
10220
+ <xsl:call-template name="refine_note-style"/>
10188
10221
 
10189
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10222
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10190
10223
 
10191
- <fo:block>
10224
+ <fo:block>
10192
10225
 
10193
- <xsl:call-template name="refine_note_block_style"/>
10226
+ <xsl:call-template name="refine_note_block_style"/>
10194
10227
 
10195
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
10228
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
10196
10229
 
10197
- <xsl:call-template name="refine_note-name-style"/>
10230
+ <xsl:call-template name="refine_note-name-style"/>
10198
10231
 
10199
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10200
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
10201
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10202
- <xsl:call-template name="append_add-style"/>
10203
- </xsl:if>
10232
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
10233
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
10234
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
10235
+ <xsl:call-template name="append_add-style"/>
10236
+ </xsl:if>
10204
10237
 
10205
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
10206
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
10207
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
10208
- <xsl:with-param name="skip">false</xsl:with-param>
10209
- </xsl:apply-templates>
10210
- </xsl:if>
10238
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
10239
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
10240
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
10241
+ <xsl:with-param name="skip">false</xsl:with-param>
10242
+ </xsl:apply-templates>
10243
+ </xsl:if>
10211
10244
 
10212
- <xsl:apply-templates select="*[local-name() = 'name']"/>
10245
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
10213
10246
 
10214
- </fo:inline>
10247
+ </fo:inline>
10215
10248
 
10216
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10217
- </fo:block>
10249
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10250
+ </fo:block>
10218
10251
 
10219
- </fo:block-container>
10220
- </fo:block-container>
10252
+ </fo:block-container>
10253
+ </fo:block-container>
10221
10254
 
10222
10255
  </xsl:template>
10223
10256
 
@@ -12554,12 +12587,14 @@
12554
12587
 
12555
12588
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
12556
12589
 
12557
- <xsl:variable name="provisional_distance_between_starts">
12590
+ <xsl:variable name="provisional_distance_between_starts_">
12558
12591
  7
12559
12592
  </xsl:variable>
12560
- <xsl:variable name="indent">
12593
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
12594
+ <xsl:variable name="indent_">
12561
12595
  0
12562
12596
  </xsl:variable>
12597
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
12563
12598
 
12564
12599
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
12565
12600
  <fo:list-item>
@@ -12623,6 +12658,7 @@
12623
12658
  </xsl:when>
12624
12659
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
12625
12660
  <fo:block xsl:use-attribute-sets="example-name-style">
12661
+
12626
12662
  <xsl:apply-templates/>
12627
12663
  </fo:block>
12628
12664
  </xsl:when>
@@ -12638,6 +12674,7 @@
12638
12674
 
12639
12675
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
12640
12676
  <fo:inline xsl:use-attribute-sets="example-name-style">
12677
+
12641
12678
  <xsl:apply-templates/>
12642
12679
  </fo:inline>
12643
12680
  </xsl:template>
@@ -13004,12 +13041,14 @@
13004
13041
 
13005
13042
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
13006
13043
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
13044
+
13007
13045
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
13008
13046
  </fo:block>
13009
13047
  </xsl:if>
13010
13048
 
13011
13049
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
13012
13050
  <xsl:call-template name="setStyle_preferred"/>
13051
+
13013
13052
  <xsl:apply-templates/>
13014
13053
  </fo:block>
13015
13054
  </fo:block>
@@ -13284,14 +13323,17 @@
13284
13323
  </xsl:when>
13285
13324
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
13286
13325
 
13287
- <xsl:variable name="label">
13326
+ <xsl:variable name="type" select="../@type"/>
13288
13327
 
13289
- <xsl:variable name="type" select="../@type"/>
13328
+ <xsl:variable name="label">
13290
13329
 
13291
13330
  <xsl:variable name="style_prefix_">
13292
13331
  <xsl:if test="$type = 'roman'">
13293
13332
  <!-- Example: (i) -->
13294
13333
  </xsl:if>
13334
+ <xsl:if test="$type = 'alphabet'">
13335
+
13336
+ </xsl:if>
13295
13337
  </xsl:variable>
13296
13338
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
13297
13339
 
@@ -13317,13 +13359,15 @@
13317
13359
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
13318
13360
  <xsl:value-of select="$style_prefix"/>
13319
13361
  </xsl:if>
13362
+
13320
13363
  <xsl:value-of select="@label"/>
13364
+
13321
13365
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
13322
13366
  <xsl:value-of select="$style_suffix"/>
13323
13367
  </xsl:if>
13324
13368
  </xsl:variable>
13325
13369
 
13326
- <xsl:value-of select="normalize-space($label)"/>
13370
+ <xsl:value-of select="normalize-space($label)"/>
13327
13371
 
13328
13372
  </xsl:when>
13329
13373
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -15672,7 +15716,8 @@
15672
15716
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
15673
15717
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
15674
15718
  <!-- Todo: need update -->
15675
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15719
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
15720
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
15676
15721
 
15677
15722
  <pdf:embedded-file filename="{$filename}" link-as-file-annotation="true">
15678
15723
  <xsl:attribute name="src">
@@ -15693,6 +15738,9 @@
15693
15738
  <xsl:if test="$afrelationship != ''">
15694
15739
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15695
15740
  </xsl:if>
15741
+ <xsl:if test="$volatile != ''">
15742
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
15743
+ </xsl:if>
15696
15744
  </pdf:embedded-file>
15697
15745
  </xsl:for-each>
15698
15746
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -15703,14 +15751,18 @@
15703
15751
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15704
15752
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15705
15753
  <!-- Todo: need update -->
15706
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
15754
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
15755
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
15707
15756
  <pdf:embedded-file src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
15708
15757
  <xsl:if test="$description != ''">
15709
15758
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15710
15759
  </xsl:if>
15711
15760
  <xsl:if test="$afrelationship != ''">
15712
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15713
- </xsl:if>
15761
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
15762
+ </xsl:if>
15763
+ <xsl:if test="$volatile != ''">
15764
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
15765
+ </xsl:if>
15714
15766
  </pdf:embedded-file>
15715
15767
  </xsl:for-each>
15716
15768
  </xsl:if>
@@ -15757,10 +15809,31 @@
15757
15809
  <xsl:value-of select="$level_total - 2"/>
15758
15810
  </xsl:when>
15759
15811
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
15760
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
15812
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
15813
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
15814
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
15815
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
15816
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
15817
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
15818
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
15819
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
15820
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
15821
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
15822
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
15761
15823
  <xsl:choose>
15762
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15763
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
15824
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
15825
+ <xsl:value-of select="number($curr_clause_depth)"/>
15826
+ </xsl:when>
15827
+ <xsl:otherwise>
15828
+ <xsl:value-of select="$level_total - 2"/>
15829
+ </xsl:otherwise>
15830
+ </xsl:choose>
15831
+ </xsl:when>
15832
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
15833
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
15834
+ <xsl:choose>
15835
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
15836
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
15764
15837
  </xsl:when>
15765
15838
  <xsl:otherwise>
15766
15839
  <xsl:value-of select="$level_total - 2"/>
@@ -15768,7 +15841,7 @@
15768
15841
  </xsl:choose>
15769
15842
  </xsl:when>
15770
15843
  <xsl:when test="ancestor::*[local-name() = 'sections']">
15771
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
15844
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
15772
15845
  <xsl:choose>
15773
15846
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
15774
15847
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -16085,9 +16158,10 @@
16085
16158
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertBackgroundPageImage">
16086
16159
  <xsl:param name="number">1</xsl:param>
16087
16160
  <xsl:param name="name">coverpage-image</xsl:param>
16161
+ <xsl:param name="suffix"/>
16088
16162
  <xsl:variable name="num" select="number($number)"/>
16089
16163
  <!-- background image -->
16090
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
16164
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
16091
16165
  <fo:block>
16092
16166
  <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
16093
16167
  <xsl:choose>
@@ -16153,16 +16227,29 @@
16153
16227
 
16154
16228
  <!-- END: insert cover page image -->
16155
16229
 
16230
+ <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
16156
16231
  <xsl:template xmlns:redirect="http://xml.apache.org/xalan/redirect" name="insertVerticalChar">
16157
16232
  <xsl:param name="str"/>
16233
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
16234
+ <xsl:param name="reference-orientation">90</xsl:param>
16158
16235
  <xsl:if test="string-length($str) &gt; 0">
16159
- <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
16236
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
16237
+ <xsl:if test="normalize-space($writing-mode) != ''">
16238
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
16239
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
16240
+ </xsl:if>
16241
+ <xsl:variable name="char" select="substring($str,1,1)"/>
16242
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
16243
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
16244
+ </xsl:if>
16160
16245
  <fo:block-container width="1em">
16161
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
16246
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
16162
16247
  </fo:block-container>
16163
16248
  </fo:inline-container>
16164
16249
  <xsl:call-template name="insertVerticalChar">
16165
16250
  <xsl:with-param name="str" select="substring($str, 2)"/>
16251
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
16252
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
16166
16253
  </xsl:call-template>
16167
16254
  </xsl:if>
16168
16255
  </xsl:template>
@@ -2,8 +2,8 @@ require "isodoc"
2
2
  require "mnconvert"
3
3
 
4
4
  module IsoDoc
5
- module IEEE
6
- class IEEEXMLConvert < IsoDoc::XslfoPdfConvert
5
+ module Ieee
6
+ class IeeeXMLConvert < IsoDoc::XslfoPdfConvert
7
7
  def initialize(options) # rubocop:disable Lint/MissingSuper
8
8
  @libdir = File.dirname(__FILE__)
9
9
  @format = :ieee
@@ -4,7 +4,7 @@ require_relative "xref"
4
4
  require_relative "i18n"
5
5
 
6
6
  module IsoDoc
7
- module IEEE
7
+ module Ieee
8
8
  module Init
9
9
  def metadata_init(lang, script, locale, i18n)
10
10
  @meta = Metadata.new(lang, script, locale, i18n)
@@ -22,7 +22,7 @@ module IsoDoc
22
22
  end
23
23
 
24
24
  def bibrenderer
25
- ::Relaton::Render::IEEE::General.new(language: @lang,
25
+ ::Relaton::Render::Ieee::General.new(language: @lang,
26
26
  i18nhash: @i18n.get)
27
27
  end
28
28
 
@@ -2,7 +2,7 @@ require "isodoc"
2
2
  require "twitter_cldr"
3
3
 
4
4
  module IsoDoc
5
- module IEEE
5
+ module Ieee
6
6
  class Metadata < IsoDoc::Metadata
7
7
  def initialize(lang, script, i18n, fonts_options = {})
8
8
  super
@@ -2,7 +2,7 @@ require "isodoc"
2
2
  require "fileutils"
3
3
 
4
4
  module IsoDoc
5
- module IEEE
5
+ module Ieee
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 IEEE
2
+ module Ieee
3
3
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
4
4
  def bibdata_i18n(bib)
5
5
  super
@@ -1,7 +1,7 @@
1
1
  require_relative "../../relaton/render/general"
2
2
 
3
3
  module IsoDoc
4
- module IEEE
4
+ module Ieee
5
5
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
6
6
  # Style manual 19
7
7
  def anchor_linkend(node, linkend)
@@ -76,14 +76,13 @@ module IsoDoc
76
76
  end
77
77
 
78
78
  def creatornames(bibitem)
79
- ::Relaton::Render::IEEE::General
79
+ ::Relaton::Render::Ieee::General
80
80
  .new(language: @lang, i18nhash: @i18n.get,
81
- #template: { (bibitem["type"] || "misc").to_sym =>
82
- #"{{ creatornames }}" },
83
- template: "{{ creatornames }}" ,
84
- extenttemplate: { (bibitem["type"] || "misc").to_sym => "{{page}}"} ,
85
- sizetemplate: { (bibitem["type"] || "misc").to_sym => "{{data}}"} ,
86
- )
81
+ # template: { (bibitem["type"] || "misc").to_sym =>
82
+ # "{{ creatornames }}" },
83
+ template: "{{ creatornames }}",
84
+ extenttemplate: { (bibitem["type"] || "misc").to_sym => "{{page}}" },
85
+ sizetemplate: { (bibitem["type"] || "misc").to_sym => "{{data}}" })
87
86
  .render1(RelatonBib::XMLParser.from_xml(bibitem.to_xml))
88
87
  end
89
88
 
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module IEEE
2
+ module Ieee
3
3
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
4
4
  def multidef(elem)
5
5
  number_multidef(elem)
@@ -5,7 +5,7 @@ require_relative "presentation_ref"
5
5
  require "isodoc"
6
6
 
7
7
  module IsoDoc
8
- module IEEE
8
+ module Ieee
9
9
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
10
10
  def initialize(options)
11
11
  @hierarchical_assets = options[:hierarchicalassets]
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module IEEE
2
+ module Ieee
3
3
  class WordConvert < IsoDoc::WordConvert
4
4
  def authority_cleanup(docxml)
5
5
  feedback_footnote(docxml)
@@ -1,8 +1,8 @@
1
1
  module IsoDoc
2
- module IEEE
2
+ module Ieee
3
3
  class WordConvert < IsoDoc::WordConvert
4
4
  def toWord(result, filename, dir, header)
5
- ::Html2Doc::IEEE.new(
5
+ ::Html2Doc::Ieee.new(
6
6
  filename: filename,
7
7
  imagedir: @localdir,
8
8
  stylesheet: @wordstylesheet&.path,
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module IEEE
2
+ module Ieee
3
3
  class WordConvert < IsoDoc::WordConvert
4
4
  # STYLE
5
5
  def admonition_cleanup(docxml)
@@ -6,7 +6,7 @@ require_relative "word_authority"
6
6
  require_relative "word_wp_convert"
7
7
 
8
8
  module IsoDoc
9
- module IEEE
9
+ module Ieee
10
10
  class WordConvert < IsoDoc::WordConvert
11
11
  def initialize(options)
12
12
  @libdir = File.dirname(__FILE__)
@@ -15,7 +15,7 @@ module IsoDoc
15
15
  end
16
16
 
17
17
  def init_wp(options)
18
- @wp = ::IsoDoc::IEEE::WordWPConvert.new(options)
18
+ @wp = ::IsoDoc::Ieee::WordWPConvert.new(options)
19
19
  end
20
20
 
21
21
  def convert1(docxml, filename, dir)
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module IEEE
2
+ module Ieee
3
3
  class WordWPConvert < WordConvert
4
4
  def stylesmap
5
5
  {
@@ -75,7 +75,7 @@ module IsoDoc
75
75
  end
76
76
 
77
77
  def toWord(result, filename, dir, header)
78
- ::Html2Doc::IEEE_WP.new(
78
+ ::Html2Doc::Ieee_Wp.new(
79
79
  filename: filename,
80
80
  imagedir: @localdir,
81
81
  stylesheet: @wordstylesheet&.path,
@@ -1,7 +1,7 @@
1
1
  require_relative "word_wp_cleanup"
2
2
 
3
3
  module IsoDoc
4
- module IEEE
4
+ module Ieee
5
5
  class WordWPConvert < WordConvert
6
6
  def initialize(options)
7
7
  @libdir ||= File.dirname(__FILE__) # rubocop:disable Lint/DisjunctiveAssignmentInConstructor
@@ -1,7 +1,7 @@
1
1
  require "isodoc"
2
2
 
3
3
  module IsoDoc
4
- module IEEE
4
+ module Ieee
5
5
  class Counter < ::IsoDoc::XrefGen::Counter
6
6
  end
7
7
 
data/lib/isodoc/ieee.rb CHANGED
@@ -7,6 +7,6 @@ require "isodoc/ieee/presentation_xml_convert"
7
7
  require "isodoc/ieee/ieee_xml_convert"
8
8
 
9
9
  module IsoDoc
10
- module IEEE
10
+ module Ieee
11
11
  end
12
12
  end