metanorma-ogc 2.3.7 → 2.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/ogc/base_convert.rb +0 -20
  3. data/lib/isodoc/ogc/html/html_ogc_intro.html +0 -1
  4. data/lib/isodoc/ogc/html/preprocess.xslt +13 -0
  5. data/lib/isodoc/ogc/html/rouge.css +38 -0
  6. data/lib/isodoc/ogc/html/word_ogc_intro.html +0 -3
  7. data/lib/isodoc/ogc/html/word_ogc_intro_wp.html +0 -3
  8. data/lib/isodoc/ogc/html_convert.rb +1 -11
  9. data/lib/isodoc/ogc/i18n-en.yaml +1 -0
  10. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +347 -96
  11. data/lib/isodoc/ogc/ogc.best-practice.xsl +347 -96
  12. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +347 -96
  13. data/lib/isodoc/ogc/ogc.community-practice.xsl +347 -96
  14. data/lib/isodoc/ogc/ogc.community-standard.xsl +347 -96
  15. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +347 -96
  16. data/lib/isodoc/ogc/ogc.draft-standard.xsl +347 -96
  17. data/lib/isodoc/ogc/ogc.engineering-report.xsl +347 -96
  18. data/lib/isodoc/ogc/ogc.other.xsl +347 -96
  19. data/lib/isodoc/ogc/ogc.policy.xsl +347 -96
  20. data/lib/isodoc/ogc/ogc.reference-model.xsl +347 -96
  21. data/lib/isodoc/ogc/ogc.release-notes.xsl +347 -96
  22. data/lib/isodoc/ogc/ogc.standard.xsl +347 -96
  23. data/lib/isodoc/ogc/ogc.test-suite.xsl +347 -96
  24. data/lib/isodoc/ogc/ogc.user-guide.xsl +347 -96
  25. data/lib/isodoc/ogc/ogc.white-paper.xsl +311 -95
  26. data/lib/isodoc/ogc/presentation_xml_convert.rb +26 -6
  27. data/lib/isodoc/ogc/sections.rb +48 -48
  28. data/lib/isodoc/ogc/word_convert.rb +3 -0
  29. data/lib/isodoc/ogc/xref.rb +12 -1
  30. data/lib/metanorma/ogc/isodoc.rng +41 -14
  31. data/lib/metanorma/ogc/ogc.rng +3 -8
  32. data/lib/metanorma/ogc/validate.rb +18 -11
  33. data/lib/metanorma/ogc/version.rb +1 -1
  34. data/metanorma-ogc.gemspec +1 -1
  35. metadata +6 -4
@@ -1351,11 +1351,17 @@
1351
1351
  <!-- ========================== -->
1352
1352
  <!-- Definition's list styles -->
1353
1353
  <!-- ========================== -->
1354
+
1355
+ <xsl:attribute-set name="dl-block-style">
1356
+
1357
+ </xsl:attribute-set>
1358
+
1354
1359
  <xsl:attribute-set name="dt-row-style">
1355
1360
 
1356
1361
  </xsl:attribute-set>
1357
1362
 
1358
1363
  <xsl:attribute-set name="dt-cell-style">
1364
+
1359
1365
  </xsl:attribute-set>
1360
1366
 
1361
1367
  <xsl:attribute-set name="dt-block-style">
@@ -1376,6 +1382,7 @@
1376
1382
 
1377
1383
  <xsl:attribute-set name="dd-cell-style">
1378
1384
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
1385
+
1379
1386
  </xsl:attribute-set>
1380
1387
 
1381
1388
  <!-- ========================== -->
@@ -1400,6 +1407,7 @@
1400
1407
  </xsl:attribute-set>
1401
1408
 
1402
1409
  <xsl:attribute-set name="xref-style">
1410
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1403
1411
 
1404
1412
  <xsl:attribute name="color">blue</xsl:attribute>
1405
1413
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -1527,6 +1535,10 @@
1527
1535
 
1528
1536
  </xsl:attribute-set>
1529
1537
 
1538
+ <xsl:attribute-set name="figure-source-style">
1539
+
1540
+ </xsl:attribute-set>
1541
+
1530
1542
  <!-- Formula's styles -->
1531
1543
  <xsl:attribute-set name="formula-style">
1532
1544
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -2079,7 +2091,7 @@
2079
2091
 
2080
2092
  <xsl:template name="processTables_Contents">
2081
2093
  <tables>
2082
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2094
+ <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2083
2095
  <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2084
2096
  <xsl:copy-of select="*[local-name() = 'name']"/>
2085
2097
  </table>
@@ -2461,7 +2473,7 @@
2461
2473
  </xsl:attribute>
2462
2474
  </xsl:for-each>
2463
2475
 
2464
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2476
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2465
2477
  <xsl:if test="$isNoteOrFnExist = 'true'">
2466
2478
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2467
2479
  </xsl:if>
@@ -2505,7 +2517,7 @@
2505
2517
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2506
2518
  </xsl:when>
2507
2519
  <xsl:otherwise>
2508
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note and dl which render separaterely -->
2520
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
2509
2521
  </xsl:otherwise>
2510
2522
  </xsl:choose>
2511
2523
 
@@ -2608,6 +2620,11 @@
2608
2620
  </xsl:if>
2609
2621
  </xsl:template> <!-- table/name -->
2610
2622
 
2623
+ <!-- SOURCE: ... -->
2624
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
2625
+ <xsl:call-template name="termsource"/>
2626
+ </xsl:template>
2627
+
2611
2628
  <xsl:template name="calculate-columns-numbers">
2612
2629
  <xsl:param name="table-row"/>
2613
2630
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2964,7 +2981,7 @@
2964
2981
  </fo:table-header>
2965
2982
  </xsl:template> <!-- thead -->
2966
2983
 
2967
- <!-- template is using for iso, jcgm, bsi only -->
2984
+ <!-- template is using for iec, iso, jcgm, bsi only -->
2968
2985
  <xsl:template name="table-header-title">
2969
2986
  <xsl:param name="cols-count"/>
2970
2987
  <!-- row for title -->
@@ -3007,7 +3024,7 @@
3007
3024
  <xsl:param name="colwidths"/>
3008
3025
  <xsl:param name="colgroup"/>
3009
3026
 
3010
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3027
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
3011
3028
 
3012
3029
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3013
3030
 
@@ -3077,6 +3094,7 @@
3077
3094
 
3078
3095
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3079
3096
  <xsl:apply-templates select="../*[local-name()='note']"/>
3097
+ <xsl:apply-templates select="../*[local-name()='source']"/>
3080
3098
 
3081
3099
  <xsl:variable name="isDisplayRowSeparator">
3082
3100
 
@@ -3435,9 +3453,13 @@
3435
3453
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
3436
3454
  </xsl:if>
3437
3455
 
3438
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3439
- <xsl:value-of select="$current_fn_number_text"/>
3440
- </fo:basic-link>
3456
+ <xsl:call-template name="insert_basic_link">
3457
+ <xsl:with-param name="element">
3458
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3459
+ <xsl:value-of select="$current_fn_number_text"/>
3460
+ </fo:basic-link>
3461
+ </xsl:with-param>
3462
+ </xsl:call-template>
3441
3463
  </fo:inline>
3442
3464
  </xsl:variable>
3443
3465
 
@@ -3720,7 +3742,7 @@
3720
3742
  <xsl:variable name="isAdded" select="@added"/>
3721
3743
  <xsl:variable name="isDeleted" select="@deleted"/>
3722
3744
  <!-- <dl><xsl:copy-of select="."/></dl> -->
3723
- <fo:block-container>
3745
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
3724
3746
 
3725
3747
  <xsl:call-template name="setBlockSpanAll"/>
3726
3748
 
@@ -3728,6 +3750,18 @@
3728
3750
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3729
3751
  </xsl:if>
3730
3752
 
3753
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
3754
+ <!-- set font-size as sourcecode font-size -->
3755
+ <xsl:variable name="sourcecode_attributes">
3756
+ <xsl:call-template name="get_sourcecode_attributes"/>
3757
+ </xsl:variable>
3758
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@font-size">
3759
+ <xsl:attribute name="{local-name()}">
3760
+ <xsl:value-of select="."/>
3761
+ </xsl:attribute>
3762
+ </xsl:for-each>
3763
+ </xsl:if>
3764
+
3731
3765
  <xsl:if test="parent::*[local-name() = 'note']">
3732
3766
  <xsl:attribute name="margin-left">
3733
3767
  <xsl:choose>
@@ -3769,8 +3803,10 @@
3769
3803
  <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
3770
3804
  <xsl:text> </xsl:text>
3771
3805
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
3772
- <xsl:text/>
3773
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
3806
+ <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
3807
+ <xsl:text> </xsl:text>
3808
+ </xsl:if>
3809
+ <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
3774
3810
  </fo:block>
3775
3811
 
3776
3812
  </xsl:when> <!-- END: only one component -->
@@ -4161,6 +4197,7 @@
4161
4197
  <xsl:param name="split_keep-within-line"/>
4162
4198
 
4163
4199
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
4200
+
4164
4201
  <xsl:call-template name="insert_dt_cell">
4165
4202
  <xsl:with-param name="key_iso" select="$key_iso"/>
4166
4203
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -4182,6 +4219,7 @@
4182
4219
  <!-- border is mandatory, to calculate real width -->
4183
4220
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4184
4221
  <xsl:attribute name="text-align">left</xsl:attribute>
4222
+
4185
4223
  </xsl:if>
4186
4224
 
4187
4225
  <fo:block xsl:use-attribute-sets="dt-block-style">
@@ -4255,8 +4293,18 @@
4255
4293
  </xsl:if>
4256
4294
  </xsl:template>
4257
4295
 
4258
- <xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
4259
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4296
+ <xsl:template match="*[local-name()='dd']/*" mode="inline">
4297
+ <xsl:variable name="is_inline_element_after_where">
4298
+ <xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
4299
+ </xsl:variable>
4300
+ <xsl:choose>
4301
+ <xsl:when test="$is_inline_element_after_where = 'true'">
4302
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
4303
+ </xsl:when>
4304
+ <xsl:otherwise>
4305
+ <xsl:apply-templates select="."/>
4306
+ </xsl:otherwise>
4307
+ </xsl:choose>
4260
4308
  </xsl:template>
4261
4309
 
4262
4310
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
@@ -4629,6 +4677,7 @@
4629
4677
  <fo:inline>
4630
4678
  <xsl:for-each select="$styles/style">
4631
4679
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
4680
+
4632
4681
  </xsl:for-each>
4633
4682
  <xsl:apply-templates/>
4634
4683
  </fo:inline>
@@ -5688,6 +5737,79 @@
5688
5737
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
5689
5738
  </xsl:template>
5690
5739
 
5740
+ <!-- special case for:
5741
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
5742
+ <mstyle displaystyle="true">
5743
+ <msup>
5744
+ <mi color="#00000000">C</mi>
5745
+ <mtext>R</mtext>
5746
+ </msup>
5747
+ <msubsup>
5748
+ <mtext>C</mtext>
5749
+ <mi>n</mi>
5750
+ <mi>k</mi>
5751
+ </msubsup>
5752
+ </mstyle>
5753
+ </math>
5754
+ -->
5755
+ <xsl:template match="mathml:msup/mathml:mi[. = '‌' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
5756
+ <xsl:copy>
5757
+ <xsl:copy-of select="@*"/>
5758
+ <xsl:variable name="next_mtext" select="ancestor::mathml:msup/following-sibling::*[1][self::mathml:msubsup or self::mathml:msub or self::mathml:msup]/mathml:mtext"/>
5759
+ <xsl:if test="string-length($next_mtext) != ''">
5760
+ <xsl:attribute name="color">#00000000</xsl:attribute>
5761
+ </xsl:if>
5762
+ <xsl:apply-templates/>
5763
+ <xsl:value-of select="$next_mtext"/>
5764
+ </xsl:copy>
5765
+ </xsl:template>
5766
+
5767
+ <!-- special case for:
5768
+ <msup>
5769
+ <mtext/>
5770
+ <mn>1</mn>
5771
+ </msup>
5772
+ convert to (add mspace after mtext and enclose them into mrow):
5773
+ <msup>
5774
+ <mrow>
5775
+ <mtext/>
5776
+ <mspace height="1.47ex"/>
5777
+ </mrow>
5778
+ <mn>1</mn>
5779
+ </msup>
5780
+ -->
5781
+ <xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
5782
+ <mathml:mrow>
5783
+ <xsl:copy-of select="."/>
5784
+ <mathml:mspace height="1.47ex"/>
5785
+ </mathml:mrow>
5786
+ </xsl:template>
5787
+
5788
+ <!-- add space around vertical line -->
5789
+ <xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
5790
+ <xsl:copy>
5791
+ <xsl:apply-templates select="@*" mode="mathml"/>
5792
+ <xsl:if test="not(@lspace)">
5793
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
5794
+ </xsl:if>
5795
+ <xsl:if test="not(@rspace)">
5796
+ <xsl:attribute name="rspace">0.4em</xsl:attribute>
5797
+ </xsl:if>
5798
+ <xsl:apply-templates mode="mathml"/>
5799
+ </xsl:copy>
5800
+ </xsl:template>
5801
+
5802
+ <!-- decrease fontsize for 'Circled Times' char -->
5803
+ <xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
5804
+ <xsl:copy>
5805
+ <xsl:apply-templates select="@*" mode="mathml"/>
5806
+ <xsl:if test="not(@fontsize)">
5807
+ <xsl:attribute name="fontsize">55%</xsl:attribute>
5808
+ </xsl:if>
5809
+ <xsl:apply-templates mode="mathml"/>
5810
+ </xsl:copy>
5811
+ </xsl:template>
5812
+
5691
5813
  <!-- Examples:
5692
5814
  <stem type="AsciiMath">x = 1</stem>
5693
5815
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -5745,19 +5867,23 @@
5745
5867
  <xsl:apply-templates/>
5746
5868
  </xsl:when>
5747
5869
  <xsl:otherwise>
5748
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
5749
- <xsl:choose>
5750
- <xsl:when test="normalize-space(.) = ''">
5751
- <xsl:call-template name="add-zero-spaces-link-java">
5752
- <xsl:with-param name="text" select="$target_text"/>
5753
- </xsl:call-template>
5754
- </xsl:when>
5755
- <xsl:otherwise>
5756
- <!-- output text from <link>text</link> -->
5757
- <xsl:apply-templates/>
5758
- </xsl:otherwise>
5759
- </xsl:choose>
5760
- </fo:basic-link>
5870
+ <xsl:call-template name="insert_basic_link">
5871
+ <xsl:with-param name="element">
5872
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
5873
+ <xsl:choose>
5874
+ <xsl:when test="normalize-space(.) = ''">
5875
+ <xsl:call-template name="add-zero-spaces-link-java">
5876
+ <xsl:with-param name="text" select="$target_text"/>
5877
+ </xsl:call-template>
5878
+ </xsl:when>
5879
+ <xsl:otherwise>
5880
+ <!-- output text from <link>text</link> -->
5881
+ <xsl:apply-templates/>
5882
+ </xsl:otherwise>
5883
+ </xsl:choose>
5884
+ </fo:basic-link>
5885
+ </xsl:with-param>
5886
+ </xsl:call-template>
5761
5887
  </xsl:otherwise>
5762
5888
  </xsl:choose>
5763
5889
  </fo:inline>
@@ -5820,12 +5946,16 @@
5820
5946
  </xsl:template>
5821
5947
 
5822
5948
  <xsl:template match="*[local-name() = 'xref']">
5823
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
5824
- <xsl:if test="parent::*[local-name() = 'add']">
5825
- <xsl:call-template name="append_add-style"/>
5826
- </xsl:if>
5827
- <xsl:apply-templates/>
5828
- </fo:basic-link>
5949
+ <xsl:call-template name="insert_basic_link">
5950
+ <xsl:with-param name="element">
5951
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
5952
+ <xsl:if test="parent::*[local-name() = 'add']">
5953
+ <xsl:call-template name="append_add-style"/>
5954
+ </xsl:if>
5955
+ <xsl:apply-templates/>
5956
+ </fo:basic-link>
5957
+ </xsl:with-param>
5958
+ </xsl:call-template>
5829
5959
  </xsl:template>
5830
5960
 
5831
5961
  <!-- ====== -->
@@ -6132,6 +6262,13 @@
6132
6262
  </fo:block>
6133
6263
  </xsl:template>
6134
6264
 
6265
+ <!-- SOURCE: ... -->
6266
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
6267
+
6268
+ <xsl:call-template name="termsource"/>
6269
+
6270
+ </xsl:template>
6271
+
6135
6272
  <xsl:template match="*[local-name() = 'image']">
6136
6273
  <xsl:variable name="isAdded" select="../@added"/>
6137
6274
  <xsl:variable name="isDeleted" select="../@deleted"/>
@@ -6205,7 +6342,7 @@
6205
6342
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
6206
6343
  </xsl:when>
6207
6344
  <xsl:when test="not(starts-with(@src, 'data:'))">
6208
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
6345
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
6209
6346
  </xsl:when>
6210
6347
  <xsl:otherwise>
6211
6348
  <xsl:value-of select="@src"/>
@@ -6227,7 +6364,7 @@
6227
6364
  </xsl:when>
6228
6365
  <xsl:when test="not(starts-with(@src, 'data:'))">
6229
6366
  <xsl:variable name="src">
6230
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
6367
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
6231
6368
  </xsl:variable>
6232
6369
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
6233
6370
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -6613,15 +6750,19 @@
6613
6750
  <xsl:param name="dest"/>
6614
6751
  <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
6615
6752
  <fo:block font-size="1pt">
6616
- <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
6617
- <fo:inline-container inline-progression-dimension="100%">
6618
- <fo:block-container height="{$height - 1}px" width="100%">
6619
- <!-- DEBUG <xsl:if test="local-name()='polygon'">
6620
- <xsl:attribute name="background-color">magenta</xsl:attribute>
6621
- </xsl:if> -->
6622
- <fo:block> </fo:block></fo:block-container>
6623
- </fo:inline-container>
6624
- </fo:basic-link>
6753
+ <xsl:call-template name="insert_basic_link">
6754
+ <xsl:with-param name="element">
6755
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
6756
+ <fo:inline-container inline-progression-dimension="100%">
6757
+ <fo:block-container height="{$height - 1}px" width="100%">
6758
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
6759
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
6760
+ </xsl:if> -->
6761
+ <fo:block> </fo:block></fo:block-container>
6762
+ </fo:inline-container>
6763
+ </fo:basic-link>
6764
+ </xsl:with-param>
6765
+ </xsl:call-template>
6625
6766
  </fo:block>
6626
6767
  </fo:block-container>
6627
6768
  </xsl:template>
@@ -7261,9 +7402,11 @@
7261
7402
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7262
7403
  </xsl:if>
7263
7404
 
7264
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7405
+ <xsl:apply-templates select="node()[not(local-name() = 'name' or local-name() = 'dl')]"/>
7265
7406
  </fo:block>
7266
7407
 
7408
+ <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
7409
+
7267
7410
  <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
7268
7411
 
7269
7412
  </fo:block-container>
@@ -7295,11 +7438,22 @@
7295
7438
  <!-- add sourcecode highlighting -->
7296
7439
  <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
7297
7440
  <xsl:variable name="class" select="@class"/>
7441
+
7442
+ <!-- Example: <1> -->
7443
+ <xsl:variable name="is_callout">
7444
+ <xsl:if test="parent::*[local-name() = 'dt']">
7445
+ <xsl:variable name="dt_id" select="../@id"/>
7446
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']//*[local-name() = 'callout'][@target = $dt_id]">true</xsl:if>
7447
+ </xsl:if>
7448
+ </xsl:variable>
7449
+
7298
7450
  <xsl:choose>
7299
7451
  <xsl:when test="$sourcecode_css//class[@name = $class]">
7300
7452
  <fo:inline>
7301
7453
  <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
7454
+ <xsl:if test="$is_callout = 'true'">&lt;</xsl:if>
7302
7455
  <xsl:apply-templates/>
7456
+ <xsl:if test="$is_callout = 'true'">&gt;</xsl:if>
7303
7457
  </fo:inline>
7304
7458
  </xsl:when>
7305
7459
  <xsl:otherwise>
@@ -7731,6 +7885,10 @@
7731
7885
  </fo:block>
7732
7886
  </xsl:template>
7733
7887
 
7888
+ <xsl:template match="*[local-name() = 'div']">
7889
+ <fo:block><xsl:apply-templates/></fo:block>
7890
+ </xsl:template>
7891
+
7734
7892
  <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
7735
7893
  <fo:block xsl:use-attribute-sets="inherit-style">
7736
7894
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
@@ -8170,14 +8328,18 @@
8170
8328
  </xsl:template>
8171
8329
 
8172
8330
  <xsl:template match="*[local-name() = 'origin']">
8173
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8174
- <xsl:if test="normalize-space(@citeas) = ''">
8175
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8176
- </xsl:if>
8177
- <fo:inline xsl:use-attribute-sets="origin-style">
8178
- <xsl:apply-templates/>
8179
- </fo:inline>
8180
- </fo:basic-link>
8331
+ <xsl:call-template name="insert_basic_link">
8332
+ <xsl:with-param name="element">
8333
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8334
+ <xsl:if test="normalize-space(@citeas) = ''">
8335
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8336
+ </xsl:if>
8337
+ <fo:inline xsl:use-attribute-sets="origin-style">
8338
+ <xsl:apply-templates/>
8339
+ </fo:inline>
8340
+ </fo:basic-link>
8341
+ </xsl:with-param>
8342
+ </xsl:call-template>
8181
8343
  </xsl:template>
8182
8344
 
8183
8345
  <!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
@@ -8251,9 +8413,13 @@
8251
8413
  <xsl:if test="../*[local-name() = 'author']">
8252
8414
  <xsl:text>, </xsl:text>
8253
8415
  </xsl:if>
8254
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8255
- <xsl:apply-templates/>
8256
- </fo:basic-link>
8416
+ <xsl:call-template name="insert_basic_link">
8417
+ <xsl:with-param name="element">
8418
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
8419
+ <xsl:apply-templates/>
8420
+ </fo:basic-link>
8421
+ </xsl:with-param>
8422
+ </xsl:call-template>
8257
8423
  </xsl:template>
8258
8424
 
8259
8425
  <xsl:template match="*[local-name() = 'author']">
@@ -8302,28 +8468,32 @@
8302
8468
  <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
8303
8469
  <xsl:variable name="text" select="normalize-space()"/>
8304
8470
 
8305
- <fo:basic-link fox:alt-text="{@citeas}">
8306
- <xsl:if test="normalize-space(@citeas) = ''">
8307
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
8308
- </xsl:if>
8309
- <xsl:if test="@type = 'inline'">
8471
+ <xsl:call-template name="insert_basic_link">
8472
+ <xsl:with-param name="element">
8473
+ <fo:basic-link fox:alt-text="{@citeas}">
8474
+ <xsl:if test="normalize-space(@citeas) = ''">
8475
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
8476
+ </xsl:if>
8477
+ <xsl:if test="@type = 'inline'">
8310
8478
 
8311
- <xsl:attribute name="color">blue</xsl:attribute>
8312
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
8479
+ <xsl:attribute name="color">blue</xsl:attribute>
8480
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
8313
8481
 
8314
- </xsl:if>
8482
+ </xsl:if>
8315
8483
 
8316
- <xsl:choose>
8317
- <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
8318
- <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
8319
- </xsl:when>
8320
- <xsl:otherwise>
8321
- <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8322
- </xsl:otherwise>
8323
- </xsl:choose>
8484
+ <xsl:choose>
8485
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
8486
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
8487
+ </xsl:when>
8488
+ <xsl:otherwise>
8489
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
8490
+ </xsl:otherwise>
8491
+ </xsl:choose>
8324
8492
 
8325
- <xsl:apply-templates/>
8326
- </fo:basic-link>
8493
+ <xsl:apply-templates/>
8494
+ </fo:basic-link>
8495
+ </xsl:with-param>
8496
+ </xsl:call-template>
8327
8497
 
8328
8498
  </fo:inline>
8329
8499
  </xsl:when>
@@ -8449,13 +8619,8 @@
8449
8619
  </xsl:template>
8450
8620
 
8451
8621
  <xsl:template match="*[local-name() = 'deprecates']">
8452
- <xsl:variable name="title-deprecated">
8453
- <xsl:call-template name="getLocalizedString">
8454
- <xsl:with-param name="key">deprecated</xsl:with-param>
8455
- </xsl:call-template>
8456
- </xsl:variable>
8457
8622
  <fo:block xsl:use-attribute-sets="deprecates-style">
8458
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
8623
+ <xsl:apply-templates/>
8459
8624
  </fo:block>
8460
8625
  </xsl:template>
8461
8626
 
@@ -8578,7 +8743,10 @@
8578
8743
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
8579
8744
 
8580
8745
  <xsl:template name="setULLabel">
8581
- <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
8746
+ <xsl:variable name="list_level__">
8747
+ <xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
8748
+ </xsl:variable>
8749
+ <xsl:variable name="list_level_" select="number($list_level__)"/>
8582
8750
  <xsl:variable name="list_level">
8583
8751
  <xsl:choose>
8584
8752
  <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
@@ -8711,9 +8879,11 @@
8711
8879
  </fo:block-container>
8712
8880
  </xsl:when>
8713
8881
  <xsl:otherwise>
8714
- <fo:block>
8715
- <xsl:apply-templates select="." mode="list"/>
8716
- </fo:block>
8882
+
8883
+ <fo:block>
8884
+ <xsl:apply-templates select="." mode="list"/>
8885
+ </fo:block>
8886
+
8717
8887
  </xsl:otherwise>
8718
8888
  </xsl:choose>
8719
8889
  </xsl:template>
@@ -9397,24 +9567,32 @@
9397
9567
  <xsl:for-each select="*[local-name() = 'tab']">
9398
9568
  <xsl:variable name="current_id" select="generate-id()"/>
9399
9569
  <fo:table-cell>
9400
- <fo:block>
9401
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9402
- <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
9403
- <xsl:choose>
9404
- <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
9405
- <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
9406
- </xsl:choose>
9407
- </xsl:for-each>
9408
- </fo:basic-link>
9570
+ <fo:block line-height-shift-adjustment="disregard-shifts">
9571
+ <xsl:call-template name="insert_basic_link">
9572
+ <xsl:with-param name="element">
9573
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9574
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
9575
+ <xsl:choose>
9576
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
9577
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
9578
+ </xsl:choose>
9579
+ </xsl:for-each>
9580
+ </fo:basic-link>
9581
+ </xsl:with-param>
9582
+ </xsl:call-template>
9409
9583
  </fo:block>
9410
9584
  </fo:table-cell>
9411
9585
  </xsl:for-each>
9412
9586
  <!-- last column - for page numbers -->
9413
9587
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
9414
9588
  <fo:block>
9415
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9416
- <fo:page-number-citation ref-id="{$target}"/>
9417
- </fo:basic-link>
9589
+ <xsl:call-template name="insert_basic_link">
9590
+ <xsl:with-param name="element">
9591
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
9592
+ <fo:page-number-citation ref-id="{$target}"/>
9593
+ </fo:basic-link>
9594
+ </xsl:with-param>
9595
+ </xsl:call-template>
9418
9596
  </fo:block>
9419
9597
  </fo:table-cell>
9420
9598
  </xsl:template>
@@ -9456,6 +9634,27 @@
9456
9634
  <!-- End Table of Contents (ToC) processing -->
9457
9635
  <!-- =================== -->
9458
9636
 
9637
+ <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
9638
+ <xsl:template name="insert_basic_link">
9639
+ <xsl:param name="element"/>
9640
+ <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
9641
+ <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
9642
+ <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
9643
+ <xsl:choose>
9644
+ <xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
9645
+ <xsl:copy-of select="$element_node"/>
9646
+ </xsl:when>
9647
+ <xsl:otherwise>
9648
+ <fo:inline>
9649
+ <xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
9650
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
9651
+ </xsl:for-each>
9652
+ <xsl:copy-of select="$element_node/fo:basic-link/node()"/>
9653
+ </fo:inline>
9654
+ </xsl:otherwise>
9655
+ </xsl:choose>
9656
+ </xsl:template>
9657
+
9459
9658
  <xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
9460
9659
  <xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
9461
9660
  <fo:inline padding-right="5mm"> </fo:inline>
@@ -9678,6 +9877,23 @@
9678
9877
  <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
9679
9878
  <xsl:copy-of select="."/>
9680
9879
  </xsl:template>
9880
+
9881
+ <!-- add @id, redundant for table auto-layout algorithm -->
9882
+ <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
9883
+ <xsl:copy>
9884
+ <xsl:copy-of select="@*"/>
9885
+ <xsl:call-template name="add_id"/>
9886
+ <xsl:apply-templates mode="update_xml_step1"/>
9887
+ </xsl:copy>
9888
+ </xsl:template>
9889
+
9890
+ <xsl:template name="add_id">
9891
+ <xsl:if test="not(@id)">
9892
+ <!-- add @id - first element with @id plus '_element_name' -->
9893
+ <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
9894
+ </xsl:if>
9895
+ </xsl:template>
9896
+
9681
9897
  <!-- =========================================================================== -->
9682
9898
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9683
9899
  <!-- =========================================================================== -->