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
@@ -46,6 +46,8 @@
46
46
  <xsl:otherwise>rgb(246, 223, 140)</xsl:otherwise>
47
47
  </xsl:choose>
48
48
  </xsl:variable>
49
+ <xsl:variable name="color_dl_dt">rgb(215,243,255)</xsl:variable>
50
+ <xsl:variable name="color_dl_dd">rgb(242,251,255)</xsl:variable>
49
51
  <xsl:variable name="color_blue">rgb(33, 55, 92)</xsl:variable>
50
52
 
51
53
  <xsl:variable name="toc_recommendations_">
@@ -845,9 +847,8 @@
845
847
  </xsl:template>
846
848
 
847
849
  <!-- ====== -->
848
- <!-- title -->
850
+ <!-- title -->
849
851
  <!-- ====== -->
850
-
851
852
  <xsl:template match="ogc:title" name="title">
852
853
 
853
854
  <xsl:variable name="level">
@@ -957,9 +958,9 @@
957
958
  </xsl:element>
958
959
  </xsl:otherwise>
959
960
  </xsl:choose>
960
-
961
961
  </xsl:template>
962
962
  <!-- ====== -->
963
+ <!-- END: title -->
963
964
  <!-- ====== -->
964
965
 
965
966
  <xsl:template match="ogc:p" name="paragraph">
@@ -993,6 +994,9 @@
993
994
  </xsl:if>
994
995
  <xsl:if test="ancestor::ogc:dd and not(ancestor::ogc:table)">
995
996
  <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
997
+ <xsl:if test="not(ancestor::ogc:dd[1]/following-sibling::ogc:dt)">
998
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
999
+ </xsl:if>
996
1000
  </xsl:if>
997
1001
 
998
1002
  <xsl:apply-templates>
@@ -2180,6 +2184,13 @@
2180
2184
  <!-- ========================== -->
2181
2185
  <!-- Definition's list styles -->
2182
2186
  <!-- ========================== -->
2187
+
2188
+ <xsl:attribute-set name="dl-block-style">
2189
+
2190
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2191
+
2192
+ </xsl:attribute-set>
2193
+
2183
2194
  <xsl:attribute-set name="dt-row-style">
2184
2195
 
2185
2196
  <xsl:attribute name="min-height">8.5mm</xsl:attribute>
@@ -2187,6 +2198,11 @@
2187
2198
  </xsl:attribute-set>
2188
2199
 
2189
2200
  <xsl:attribute-set name="dt-cell-style">
2201
+
2202
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2203
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
2204
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
2205
+
2190
2206
  </xsl:attribute-set>
2191
2207
 
2192
2208
  <xsl:attribute-set name="dt-block-style">
@@ -2207,6 +2223,9 @@
2207
2223
 
2208
2224
  <xsl:attribute-set name="dd-cell-style">
2209
2225
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
2226
+
2227
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2228
+
2210
2229
  </xsl:attribute-set>
2211
2230
 
2212
2231
  <!-- ========================== -->
@@ -2231,6 +2250,7 @@
2231
2250
  </xsl:attribute-set>
2232
2251
 
2233
2252
  <xsl:attribute-set name="xref-style">
2253
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
2234
2254
 
2235
2255
  </xsl:attribute-set>
2236
2256
 
@@ -2352,6 +2372,10 @@
2352
2372
 
2353
2373
  </xsl:attribute-set>
2354
2374
 
2375
+ <xsl:attribute-set name="figure-source-style">
2376
+
2377
+ </xsl:attribute-set>
2378
+
2355
2379
  <!-- Formula's styles -->
2356
2380
  <xsl:attribute-set name="formula-style">
2357
2381
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -2904,7 +2928,7 @@
2904
2928
 
2905
2929
  <xsl:template name="processTables_Contents">
2906
2930
  <tables>
2907
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2931
+ <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2908
2932
  <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2909
2933
  <xsl:copy-of select="*[local-name() = 'name']"/>
2910
2934
  </table>
@@ -3271,7 +3295,7 @@
3271
3295
  </xsl:attribute>
3272
3296
  </xsl:for-each>
3273
3297
 
3274
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
3298
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
3275
3299
  <xsl:if test="$isNoteOrFnExist = 'true'">
3276
3300
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3277
3301
  </xsl:if>
@@ -3315,7 +3339,7 @@
3315
3339
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3316
3340
  </xsl:when>
3317
3341
  <xsl:otherwise>
3318
- <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 -->
3342
+ <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 -->
3319
3343
  </xsl:otherwise>
3320
3344
  </xsl:choose>
3321
3345
 
@@ -3416,6 +3440,11 @@
3416
3440
  </xsl:if>
3417
3441
  </xsl:template> <!-- table/name -->
3418
3442
 
3443
+ <!-- SOURCE: ... -->
3444
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
3445
+ <xsl:call-template name="termsource"/>
3446
+ </xsl:template>
3447
+
3419
3448
  <xsl:template name="calculate-columns-numbers">
3420
3449
  <xsl:param name="table-row"/>
3421
3450
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -3772,7 +3801,7 @@
3772
3801
  </fo:table-header>
3773
3802
  </xsl:template> <!-- thead -->
3774
3803
 
3775
- <!-- template is using for iso, jcgm, bsi only -->
3804
+ <!-- template is using for iec, iso, jcgm, bsi only -->
3776
3805
  <xsl:template name="table-header-title">
3777
3806
  <xsl:param name="cols-count"/>
3778
3807
  <!-- row for title -->
@@ -3815,7 +3844,7 @@
3815
3844
  <xsl:param name="colwidths"/>
3816
3845
  <xsl:param name="colgroup"/>
3817
3846
 
3818
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3847
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
3819
3848
 
3820
3849
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3821
3850
 
@@ -3885,6 +3914,7 @@
3885
3914
 
3886
3915
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3887
3916
  <xsl:apply-templates select="../*[local-name()='note']"/>
3917
+ <xsl:apply-templates select="../*[local-name()='source']"/>
3888
3918
 
3889
3919
  <xsl:variable name="isDisplayRowSeparator">
3890
3920
 
@@ -4257,9 +4287,13 @@
4257
4287
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4258
4288
  </xsl:if>
4259
4289
 
4260
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4261
- <xsl:value-of select="$current_fn_number_text"/>
4262
- </fo:basic-link>
4290
+ <xsl:call-template name="insert_basic_link">
4291
+ <xsl:with-param name="element">
4292
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4293
+ <xsl:value-of select="$current_fn_number_text"/>
4294
+ </fo:basic-link>
4295
+ </xsl:with-param>
4296
+ </xsl:call-template>
4263
4297
  </fo:inline>
4264
4298
  </xsl:variable>
4265
4299
 
@@ -4542,7 +4576,7 @@
4542
4576
  <xsl:variable name="isAdded" select="@added"/>
4543
4577
  <xsl:variable name="isDeleted" select="@deleted"/>
4544
4578
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4545
- <fo:block-container>
4579
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
4546
4580
 
4547
4581
  <xsl:call-template name="setBlockSpanAll"/>
4548
4582
 
@@ -4550,6 +4584,18 @@
4550
4584
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
4551
4585
  </xsl:if>
4552
4586
 
4587
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
4588
+ <!-- set font-size as sourcecode font-size -->
4589
+ <xsl:variable name="sourcecode_attributes">
4590
+ <xsl:call-template name="get_sourcecode_attributes"/>
4591
+ </xsl:variable>
4592
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@font-size">
4593
+ <xsl:attribute name="{local-name()}">
4594
+ <xsl:value-of select="."/>
4595
+ </xsl:attribute>
4596
+ </xsl:for-each>
4597
+ </xsl:if>
4598
+
4553
4599
  <xsl:if test="parent::*[local-name() = 'note']">
4554
4600
  <xsl:attribute name="margin-left">
4555
4601
  <xsl:choose>
@@ -4591,8 +4637,10 @@
4591
4637
  <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
4592
4638
  <xsl:text> </xsl:text>
4593
4639
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
4594
- <xsl:text/>
4595
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
4640
+ <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
4641
+ <xsl:text> </xsl:text>
4642
+ </xsl:if>
4643
+ <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
4596
4644
  </fo:block>
4597
4645
 
4598
4646
  </xsl:when> <!-- END: only one component -->
@@ -4983,6 +5031,11 @@
4983
5031
  <xsl:param name="split_keep-within-line"/>
4984
5032
 
4985
5033
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
5034
+
5035
+ <xsl:if test="not(following-sibling::ogc:dt) or ancestor::ogc:sourcecode"> <!-- last item -->
5036
+ <xsl:attribute name="min-height">3mm</xsl:attribute>
5037
+ </xsl:if>
5038
+
4986
5039
  <xsl:call-template name="insert_dt_cell">
4987
5040
  <xsl:with-param name="key_iso" select="$key_iso"/>
4988
5041
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -5004,8 +5057,17 @@
5004
5057
  <!-- border is mandatory, to calculate real width -->
5005
5058
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5006
5059
  <xsl:attribute name="text-align">left</xsl:attribute>
5060
+
5061
+ <xsl:attribute name="padding-left">6mm</xsl:attribute>
5062
+ <!-- <xsl:attribute name="padding-left">6.5mm</xsl:attribute> -->
5063
+
5007
5064
  </xsl:if>
5008
5065
 
5066
+ <xsl:if test="not(ancestor::ogc:sourcecode)">
5067
+ <!-- <xsl:attribute name="border-left">1pt solid <xsl:value-of select="$color_design"/></xsl:attribute> -->
5068
+ <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dt"/></xsl:attribute>
5069
+ </xsl:if>
5070
+
5009
5071
  <fo:block xsl:use-attribute-sets="dt-block-style">
5010
5072
  <xsl:copy-of select="@id"/>
5011
5073
 
@@ -5013,6 +5075,13 @@
5013
5075
  <xsl:attribute name="margin-top">0</xsl:attribute>
5014
5076
  </xsl:if>
5015
5077
 
5078
+ <xsl:if test="ancestor::ogc:sourcecode">
5079
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
5080
+ </xsl:if>
5081
+ <xsl:if test="not(following-sibling::ogc:dt)"> <!-- last dt -->
5082
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
5083
+ </xsl:if>
5084
+
5016
5085
  <xsl:apply-templates>
5017
5086
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5018
5087
  </xsl:apply-templates>
@@ -5032,6 +5101,10 @@
5032
5101
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5033
5102
  </xsl:if>
5034
5103
 
5104
+ <xsl:if test="not(ancestor::ogc:sourcecode)">
5105
+ <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dd"/></xsl:attribute>
5106
+ </xsl:if>
5107
+
5035
5108
  <fo:block>
5036
5109
 
5037
5110
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -5077,8 +5150,18 @@
5077
5150
  </xsl:if>
5078
5151
  </xsl:template>
5079
5152
 
5080
- <xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
5081
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
5153
+ <xsl:template match="*[local-name()='dd']/*" mode="inline">
5154
+ <xsl:variable name="is_inline_element_after_where">
5155
+ <xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
5156
+ </xsl:variable>
5157
+ <xsl:choose>
5158
+ <xsl:when test="$is_inline_element_after_where = 'true'">
5159
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
5160
+ </xsl:when>
5161
+ <xsl:otherwise>
5162
+ <xsl:apply-templates select="."/>
5163
+ </xsl:otherwise>
5164
+ </xsl:choose>
5082
5165
  </xsl:template>
5083
5166
 
5084
5167
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
@@ -5451,6 +5534,7 @@
5451
5534
  <fo:inline>
5452
5535
  <xsl:for-each select="$styles/style">
5453
5536
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
5537
+
5454
5538
  </xsl:for-each>
5455
5539
  <xsl:apply-templates/>
5456
5540
  </fo:inline>
@@ -6510,6 +6594,79 @@
6510
6594
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
6511
6595
  </xsl:template>
6512
6596
 
6597
+ <!-- special case for:
6598
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
6599
+ <mstyle displaystyle="true">
6600
+ <msup>
6601
+ <mi color="#00000000">C</mi>
6602
+ <mtext>R</mtext>
6603
+ </msup>
6604
+ <msubsup>
6605
+ <mtext>C</mtext>
6606
+ <mi>n</mi>
6607
+ <mi>k</mi>
6608
+ </msubsup>
6609
+ </mstyle>
6610
+ </math>
6611
+ -->
6612
+ <xsl:template match="mathml:msup/mathml:mi[. = '‌' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
6613
+ <xsl:copy>
6614
+ <xsl:copy-of select="@*"/>
6615
+ <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"/>
6616
+ <xsl:if test="string-length($next_mtext) != ''">
6617
+ <xsl:attribute name="color">#00000000</xsl:attribute>
6618
+ </xsl:if>
6619
+ <xsl:apply-templates/>
6620
+ <xsl:value-of select="$next_mtext"/>
6621
+ </xsl:copy>
6622
+ </xsl:template>
6623
+
6624
+ <!-- special case for:
6625
+ <msup>
6626
+ <mtext/>
6627
+ <mn>1</mn>
6628
+ </msup>
6629
+ convert to (add mspace after mtext and enclose them into mrow):
6630
+ <msup>
6631
+ <mrow>
6632
+ <mtext/>
6633
+ <mspace height="1.47ex"/>
6634
+ </mrow>
6635
+ <mn>1</mn>
6636
+ </msup>
6637
+ -->
6638
+ <xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
6639
+ <mathml:mrow>
6640
+ <xsl:copy-of select="."/>
6641
+ <mathml:mspace height="1.47ex"/>
6642
+ </mathml:mrow>
6643
+ </xsl:template>
6644
+
6645
+ <!-- add space around vertical line -->
6646
+ <xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
6647
+ <xsl:copy>
6648
+ <xsl:apply-templates select="@*" mode="mathml"/>
6649
+ <xsl:if test="not(@lspace)">
6650
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6651
+ </xsl:if>
6652
+ <xsl:if test="not(@rspace)">
6653
+ <xsl:attribute name="rspace">0.4em</xsl:attribute>
6654
+ </xsl:if>
6655
+ <xsl:apply-templates mode="mathml"/>
6656
+ </xsl:copy>
6657
+ </xsl:template>
6658
+
6659
+ <!-- decrease fontsize for 'Circled Times' char -->
6660
+ <xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
6661
+ <xsl:copy>
6662
+ <xsl:apply-templates select="@*" mode="mathml"/>
6663
+ <xsl:if test="not(@fontsize)">
6664
+ <xsl:attribute name="fontsize">55%</xsl:attribute>
6665
+ </xsl:if>
6666
+ <xsl:apply-templates mode="mathml"/>
6667
+ </xsl:copy>
6668
+ </xsl:template>
6669
+
6513
6670
  <!-- Examples:
6514
6671
  <stem type="AsciiMath">x = 1</stem>
6515
6672
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6567,19 +6724,23 @@
6567
6724
  <xsl:apply-templates/>
6568
6725
  </xsl:when>
6569
6726
  <xsl:otherwise>
6570
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6571
- <xsl:choose>
6572
- <xsl:when test="normalize-space(.) = ''">
6573
- <xsl:call-template name="add-zero-spaces-link-java">
6574
- <xsl:with-param name="text" select="$target_text"/>
6575
- </xsl:call-template>
6576
- </xsl:when>
6577
- <xsl:otherwise>
6578
- <!-- output text from <link>text</link> -->
6579
- <xsl:apply-templates/>
6580
- </xsl:otherwise>
6581
- </xsl:choose>
6582
- </fo:basic-link>
6727
+ <xsl:call-template name="insert_basic_link">
6728
+ <xsl:with-param name="element">
6729
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6730
+ <xsl:choose>
6731
+ <xsl:when test="normalize-space(.) = ''">
6732
+ <xsl:call-template name="add-zero-spaces-link-java">
6733
+ <xsl:with-param name="text" select="$target_text"/>
6734
+ </xsl:call-template>
6735
+ </xsl:when>
6736
+ <xsl:otherwise>
6737
+ <!-- output text from <link>text</link> -->
6738
+ <xsl:apply-templates/>
6739
+ </xsl:otherwise>
6740
+ </xsl:choose>
6741
+ </fo:basic-link>
6742
+ </xsl:with-param>
6743
+ </xsl:call-template>
6583
6744
  </xsl:otherwise>
6584
6745
  </xsl:choose>
6585
6746
  </fo:inline>
@@ -6646,12 +6807,16 @@
6646
6807
  </xsl:template>
6647
6808
 
6648
6809
  <xsl:template match="*[local-name() = 'xref']">
6649
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6650
- <xsl:if test="parent::*[local-name() = 'add']">
6651
- <xsl:call-template name="append_add-style"/>
6652
- </xsl:if>
6653
- <xsl:apply-templates/>
6654
- </fo:basic-link>
6810
+ <xsl:call-template name="insert_basic_link">
6811
+ <xsl:with-param name="element">
6812
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6813
+ <xsl:if test="parent::*[local-name() = 'add']">
6814
+ <xsl:call-template name="append_add-style"/>
6815
+ </xsl:if>
6816
+ <xsl:apply-templates/>
6817
+ </fo:basic-link>
6818
+ </xsl:with-param>
6819
+ </xsl:call-template>
6655
6820
  </xsl:template>
6656
6821
 
6657
6822
  <!-- ====== -->
@@ -6960,6 +7125,13 @@
6960
7125
  </fo:block>
6961
7126
  </xsl:template>
6962
7127
 
7128
+ <!-- SOURCE: ... -->
7129
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
7130
+
7131
+ <xsl:call-template name="termsource"/>
7132
+
7133
+ </xsl:template>
7134
+
6963
7135
  <xsl:template match="*[local-name() = 'image']">
6964
7136
  <xsl:variable name="isAdded" select="../@added"/>
6965
7137
  <xsl:variable name="isDeleted" select="../@deleted"/>
@@ -7033,7 +7205,7 @@
7033
7205
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
7034
7206
  </xsl:when>
7035
7207
  <xsl:when test="not(starts-with(@src, 'data:'))">
7036
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
7208
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7037
7209
  </xsl:when>
7038
7210
  <xsl:otherwise>
7039
7211
  <xsl:value-of select="@src"/>
@@ -7055,7 +7227,7 @@
7055
7227
  </xsl:when>
7056
7228
  <xsl:when test="not(starts-with(@src, 'data:'))">
7057
7229
  <xsl:variable name="src">
7058
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
7230
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7059
7231
  </xsl:variable>
7060
7232
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7061
7233
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -7441,15 +7613,19 @@
7441
7613
  <xsl:param name="dest"/>
7442
7614
  <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
7443
7615
  <fo:block font-size="1pt">
7444
- <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7445
- <fo:inline-container inline-progression-dimension="100%">
7446
- <fo:block-container height="{$height - 1}px" width="100%">
7447
- <!-- DEBUG <xsl:if test="local-name()='polygon'">
7448
- <xsl:attribute name="background-color">magenta</xsl:attribute>
7449
- </xsl:if> -->
7450
- <fo:block> </fo:block></fo:block-container>
7451
- </fo:inline-container>
7452
- </fo:basic-link>
7616
+ <xsl:call-template name="insert_basic_link">
7617
+ <xsl:with-param name="element">
7618
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7619
+ <fo:inline-container inline-progression-dimension="100%">
7620
+ <fo:block-container height="{$height - 1}px" width="100%">
7621
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
7622
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
7623
+ </xsl:if> -->
7624
+ <fo:block> </fo:block></fo:block-container>
7625
+ </fo:inline-container>
7626
+ </fo:basic-link>
7627
+ </xsl:with-param>
7628
+ </xsl:call-template>
7453
7629
  </fo:block>
7454
7630
  </fo:block-container>
7455
7631
  </xsl:template>
@@ -8120,9 +8296,11 @@
8120
8296
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8121
8297
  </xsl:if>
8122
8298
 
8123
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8299
+ <xsl:apply-templates select="node()[not(local-name() = 'name' or local-name() = 'dl')]"/>
8124
8300
  </fo:block>
8125
8301
 
8302
+ <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
8303
+
8126
8304
  <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
8127
8305
 
8128
8306
  <xsl:if test="parent::*[local-name() = 'example']">
@@ -8158,11 +8336,22 @@
8158
8336
  <!-- add sourcecode highlighting -->
8159
8337
  <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
8160
8338
  <xsl:variable name="class" select="@class"/>
8339
+
8340
+ <!-- Example: <1> -->
8341
+ <xsl:variable name="is_callout">
8342
+ <xsl:if test="parent::*[local-name() = 'dt']">
8343
+ <xsl:variable name="dt_id" select="../@id"/>
8344
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']//*[local-name() = 'callout'][@target = $dt_id]">true</xsl:if>
8345
+ </xsl:if>
8346
+ </xsl:variable>
8347
+
8161
8348
  <xsl:choose>
8162
8349
  <xsl:when test="$sourcecode_css//class[@name = $class]">
8163
8350
  <fo:inline>
8164
8351
  <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
8352
+ <xsl:if test="$is_callout = 'true'">&lt;</xsl:if>
8165
8353
  <xsl:apply-templates/>
8354
+ <xsl:if test="$is_callout = 'true'">&gt;</xsl:if>
8166
8355
  </fo:inline>
8167
8356
  </xsl:when>
8168
8357
  <xsl:otherwise>
@@ -8594,6 +8783,10 @@
8594
8783
  </fo:block>
8595
8784
  </xsl:template>
8596
8785
 
8786
+ <xsl:template match="*[local-name() = 'div']">
8787
+ <fo:block><xsl:apply-templates/></fo:block>
8788
+ </xsl:template>
8789
+
8597
8790
  <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']">
8598
8791
  <fo:block xsl:use-attribute-sets="inherit-style">
8599
8792
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
@@ -9033,14 +9226,18 @@
9033
9226
  </xsl:template>
9034
9227
 
9035
9228
  <xsl:template match="*[local-name() = 'origin']">
9036
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9037
- <xsl:if test="normalize-space(@citeas) = ''">
9038
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9039
- </xsl:if>
9040
- <fo:inline xsl:use-attribute-sets="origin-style">
9041
- <xsl:apply-templates/>
9042
- </fo:inline>
9043
- </fo:basic-link>
9229
+ <xsl:call-template name="insert_basic_link">
9230
+ <xsl:with-param name="element">
9231
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9232
+ <xsl:if test="normalize-space(@citeas) = ''">
9233
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9234
+ </xsl:if>
9235
+ <fo:inline xsl:use-attribute-sets="origin-style">
9236
+ <xsl:apply-templates/>
9237
+ </fo:inline>
9238
+ </fo:basic-link>
9239
+ </xsl:with-param>
9240
+ </xsl:call-template>
9044
9241
  </xsl:template>
9045
9242
 
9046
9243
  <!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
@@ -9114,9 +9311,13 @@
9114
9311
  <xsl:if test="../*[local-name() = 'author']">
9115
9312
  <xsl:text>, </xsl:text>
9116
9313
  </xsl:if>
9117
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9118
- <xsl:apply-templates/>
9119
- </fo:basic-link>
9314
+ <xsl:call-template name="insert_basic_link">
9315
+ <xsl:with-param name="element">
9316
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9317
+ <xsl:apply-templates/>
9318
+ </fo:basic-link>
9319
+ </xsl:with-param>
9320
+ </xsl:call-template>
9120
9321
  </xsl:template>
9121
9322
 
9122
9323
  <xsl:template match="*[local-name() = 'author']">
@@ -9165,25 +9366,29 @@
9165
9366
  <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
9166
9367
  <xsl:variable name="text" select="normalize-space()"/>
9167
9368
 
9168
- <fo:basic-link fox:alt-text="{@citeas}">
9169
- <xsl:if test="normalize-space(@citeas) = ''">
9170
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
9171
- </xsl:if>
9172
- <xsl:if test="@type = 'inline'">
9369
+ <xsl:call-template name="insert_basic_link">
9370
+ <xsl:with-param name="element">
9371
+ <fo:basic-link fox:alt-text="{@citeas}">
9372
+ <xsl:if test="normalize-space(@citeas) = ''">
9373
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
9374
+ </xsl:if>
9375
+ <xsl:if test="@type = 'inline'">
9173
9376
 
9174
- </xsl:if>
9377
+ </xsl:if>
9175
9378
 
9176
- <xsl:choose>
9177
- <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
9178
- <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
9179
- </xsl:when>
9180
- <xsl:otherwise>
9181
- <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9182
- </xsl:otherwise>
9183
- </xsl:choose>
9379
+ <xsl:choose>
9380
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
9381
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
9382
+ </xsl:when>
9383
+ <xsl:otherwise>
9384
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9385
+ </xsl:otherwise>
9386
+ </xsl:choose>
9184
9387
 
9185
- <xsl:apply-templates/>
9186
- </fo:basic-link>
9388
+ <xsl:apply-templates/>
9389
+ </fo:basic-link>
9390
+ </xsl:with-param>
9391
+ </xsl:call-template>
9187
9392
 
9188
9393
  </fo:inline>
9189
9394
  </xsl:when>
@@ -9300,13 +9505,8 @@
9300
9505
  </xsl:template>
9301
9506
 
9302
9507
  <xsl:template match="*[local-name() = 'deprecates']">
9303
- <xsl:variable name="title-deprecated">
9304
- <xsl:call-template name="getLocalizedString">
9305
- <xsl:with-param name="key">deprecated</xsl:with-param>
9306
- </xsl:call-template>
9307
- </xsl:variable>
9308
9508
  <fo:block xsl:use-attribute-sets="deprecates-style">
9309
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
9509
+ <xsl:apply-templates/>
9310
9510
  </fo:block>
9311
9511
  </xsl:template>
9312
9512
 
@@ -9429,7 +9629,10 @@
9429
9629
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
9430
9630
 
9431
9631
  <xsl:template name="setULLabel">
9432
- <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9632
+ <xsl:variable name="list_level__">
9633
+ <xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9634
+ </xsl:variable>
9635
+ <xsl:variable name="list_level_" select="number($list_level__)"/>
9433
9636
  <xsl:variable name="list_level">
9434
9637
  <xsl:choose>
9435
9638
  <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
@@ -9562,9 +9765,11 @@
9562
9765
  </fo:block-container>
9563
9766
  </xsl:when>
9564
9767
  <xsl:otherwise>
9565
- <fo:block>
9566
- <xsl:apply-templates select="." mode="list"/>
9567
- </fo:block>
9768
+
9769
+ <fo:block>
9770
+ <xsl:apply-templates select="." mode="list"/>
9771
+ </fo:block>
9772
+
9568
9773
  </xsl:otherwise>
9569
9774
  </xsl:choose>
9570
9775
  </xsl:template>
@@ -10256,24 +10461,32 @@
10256
10461
  <xsl:for-each select="*[local-name() = 'tab']">
10257
10462
  <xsl:variable name="current_id" select="generate-id()"/>
10258
10463
  <fo:table-cell>
10259
- <fo:block>
10260
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10261
- <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
10262
- <xsl:choose>
10263
- <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
10264
- <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
10265
- </xsl:choose>
10266
- </xsl:for-each>
10267
- </fo:basic-link>
10464
+ <fo:block line-height-shift-adjustment="disregard-shifts">
10465
+ <xsl:call-template name="insert_basic_link">
10466
+ <xsl:with-param name="element">
10467
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10468
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
10469
+ <xsl:choose>
10470
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
10471
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
10472
+ </xsl:choose>
10473
+ </xsl:for-each>
10474
+ </fo:basic-link>
10475
+ </xsl:with-param>
10476
+ </xsl:call-template>
10268
10477
  </fo:block>
10269
10478
  </fo:table-cell>
10270
10479
  </xsl:for-each>
10271
10480
  <!-- last column - for page numbers -->
10272
10481
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
10273
10482
  <fo:block>
10274
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10275
- <fo:page-number-citation ref-id="{$target}"/>
10276
- </fo:basic-link>
10483
+ <xsl:call-template name="insert_basic_link">
10484
+ <xsl:with-param name="element">
10485
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10486
+ <fo:page-number-citation ref-id="{$target}"/>
10487
+ </fo:basic-link>
10488
+ </xsl:with-param>
10489
+ </xsl:call-template>
10277
10490
  </fo:block>
10278
10491
  </fo:table-cell>
10279
10492
  </xsl:template>
@@ -10315,6 +10528,27 @@
10315
10528
  <!-- End Table of Contents (ToC) processing -->
10316
10529
  <!-- =================== -->
10317
10530
 
10531
+ <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
10532
+ <xsl:template name="insert_basic_link">
10533
+ <xsl:param name="element"/>
10534
+ <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
10535
+ <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
10536
+ <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
10537
+ <xsl:choose>
10538
+ <xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
10539
+ <xsl:copy-of select="$element_node"/>
10540
+ </xsl:when>
10541
+ <xsl:otherwise>
10542
+ <fo:inline>
10543
+ <xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
10544
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
10545
+ </xsl:for-each>
10546
+ <xsl:copy-of select="$element_node/fo:basic-link/node()"/>
10547
+ </fo:inline>
10548
+ </xsl:otherwise>
10549
+ </xsl:choose>
10550
+ </xsl:template>
10551
+
10318
10552
  <xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
10319
10553
  <xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
10320
10554
  <fo:inline padding-right="5mm"> </fo:inline>
@@ -10537,6 +10771,23 @@
10537
10771
  <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
10538
10772
  <xsl:copy-of select="."/>
10539
10773
  </xsl:template>
10774
+
10775
+ <!-- add @id, redundant for table auto-layout algorithm -->
10776
+ <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
10777
+ <xsl:copy>
10778
+ <xsl:copy-of select="@*"/>
10779
+ <xsl:call-template name="add_id"/>
10780
+ <xsl:apply-templates mode="update_xml_step1"/>
10781
+ </xsl:copy>
10782
+ </xsl:template>
10783
+
10784
+ <xsl:template name="add_id">
10785
+ <xsl:if test="not(@id)">
10786
+ <!-- add @id - first element with @id plus '_element_name' -->
10787
+ <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
10788
+ </xsl:if>
10789
+ </xsl:template>
10790
+
10540
10791
  <!-- =========================================================================== -->
10541
10792
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10542
10793
  <!-- =========================================================================== -->