metanorma-ogc 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -576,7 +576,7 @@
576
576
  <fo:block line-height="125%">
577
577
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
578
578
 
579
- <xsl:for-each select="/*/*[local-name()='preface']/*">
579
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
580
580
  <xsl:sort select="@displayorder" data-type="number"/>
581
581
 
582
582
  <xsl:if test="local-name() = 'foreword' or (local-name() = 'clause' and @type = 'security') or (local-name() = 'clause' and @type = 'submitting_orgs') or local-name() = 'introduction'">
@@ -1464,14 +1464,41 @@
1464
1464
  </fo:static-content>
1465
1465
  </xsl:template>
1466
1466
 
1467
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_">
1467
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:variable name="table_widths_from_if_calculated_">
1468
+ <xsl:for-each select="$table_widths_from_if//table">
1469
+ <xsl:copy>
1470
+ <xsl:copy-of select="@*"/>
1471
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/>
1472
+ </xsl:copy>
1473
+ </xsl:for-each>
1474
+ </xsl:variable><xsl:variable name="table_widths_from_if_calculated" select="xalan:nodeset($table_widths_from_if_calculated_)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_">
1468
1475
  false
1469
1476
  </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
1470
1477
  <xsl:call-template name="getLang"/>
1471
- </xsl:variable><xsl:variable name="pageWidth_">
1472
- 215.9
1478
+ </xsl:variable><xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/><xsl:variable name="papersize_width_">
1479
+ <xsl:choose>
1480
+ <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
1481
+ <xsl:when test="$papersize = 'a4'">210</xsl:when>
1482
+ </xsl:choose>
1483
+ </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_">
1484
+ <xsl:choose>
1485
+ <xsl:when test="$papersize = 'letter'">279.4</xsl:when>
1486
+ <xsl:when test="$papersize = 'a4'">297</xsl:when>
1487
+ </xsl:choose>
1488
+ </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_">
1489
+ <xsl:choose>
1490
+ <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when>
1491
+ <xsl:otherwise>
1492
+ 215.9
1493
+ </xsl:otherwise>
1494
+ </xsl:choose>
1473
1495
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
1474
- 279.4
1496
+ <xsl:choose>
1497
+ <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when>
1498
+ <xsl:otherwise>
1499
+ 279.4
1500
+ </xsl:otherwise>
1501
+ </xsl:choose>
1475
1502
  </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
1476
1503
  35
1477
1504
  </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
@@ -2120,6 +2147,26 @@
2120
2147
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2121
2148
 
2122
2149
 
2150
+ </xsl:attribute-set><xsl:attribute-set name="dl-name-style">
2151
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2152
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2153
+
2154
+
2155
+
2156
+
2157
+
2158
+
2159
+
2160
+
2161
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2162
+ <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
2163
+
2164
+
2165
+
2166
+
2167
+
2168
+
2169
+
2123
2170
  </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
2124
2171
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
2125
2172
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
@@ -2454,6 +2501,25 @@
2454
2501
 
2455
2502
 
2456
2503
 
2504
+ </xsl:attribute-set><xsl:attribute-set name="list-name-style">
2505
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
2506
+
2507
+
2508
+
2509
+
2510
+
2511
+
2512
+
2513
+
2514
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2515
+ <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
2516
+
2517
+
2518
+
2519
+
2520
+
2521
+
2522
+
2457
2523
  </xsl:attribute-set><xsl:attribute-set name="list-item-style">
2458
2524
 
2459
2525
 
@@ -2868,13 +2934,13 @@
2868
2934
 
2869
2935
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
2870
2936
  <xsl:variable name="nodes_preface_">
2871
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2937
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2872
2938
  <node id="{@id}"/>
2873
2939
  </xsl:for-each>
2874
2940
  </xsl:variable>
2875
2941
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2876
2942
 
2877
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2943
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2878
2944
  <xsl:sort select="@displayorder" data-type="number"/>
2879
2945
 
2880
2946
  <!-- process Section's title -->
@@ -2940,7 +3006,7 @@
2940
3006
  </xsl:for-each>
2941
3007
  </figures>
2942
3008
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2943
- <xsl:for-each select="/*/*[local-name()='preface']/*">
3009
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2944
3010
  <xsl:sort select="@displayorder" data-type="number"/>
2945
3011
  <xsl:apply-templates select="."/>
2946
3012
  </xsl:for-each>
@@ -3573,8 +3639,9 @@
3573
3639
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
3574
3640
  </xsl:if>
3575
3641
  </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
3576
- <xsl:param name="table"/>
3577
- <xsl:param name="if">false</xsl:param> <!-- via intermediate format -->
3642
+ <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
3643
+
3644
+ <!-- via intermediate format -->
3578
3645
 
3579
3646
  <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
3580
3647
 
@@ -3585,9 +3652,8 @@
3585
3652
  <!-- get current table id -->
3586
3653
  <xsl:variable name="table_id" select="@id"/>
3587
3654
  <!-- find table by id in the file 'table_widths' -->
3588
- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
3589
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/>
3590
-
3655
+ <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
3656
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
3591
3657
 
3592
3658
  <!-- table='<xsl:copy-of select="$table"/>' -->
3593
3659
  <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
@@ -3595,24 +3661,13 @@
3595
3661
  <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
3596
3662
 
3597
3663
  <xsl:variable name="table_with_cell_widths_">
3598
- <xsl:choose>
3599
- <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF -->
3600
-
3601
- <!-- Example: <column>10</column>
3602
- <column>11</column>
3603
- -->
3604
- <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/>
3605
- </xsl:when>
3606
- <xsl:otherwise>
3607
- <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/>
3608
- </xsl:otherwise>
3609
- </xsl:choose>
3664
+ <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
3610
3665
  </xsl:variable>
3611
3666
  <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
3612
3667
 
3613
- <xsl:if test="$table_if_debug = 'true'">
3668
+ <!-- <xsl:if test="$table_if_debug = 'true'">
3614
3669
  <xsl:copy-of select="$table_with_cell_widths"/>
3615
- </xsl:if>
3670
+ </xsl:if> -->
3616
3671
 
3617
3672
 
3618
3673
  <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
@@ -3658,8 +3713,12 @@
3658
3713
 
3659
3714
  <xsl:variable name="page_width">
3660
3715
  <xsl:choose>
3661
- <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when>
3662
- <xsl:otherwise>75</xsl:otherwise>
3716
+ <xsl:when test="$parent_table_page-width != ''">
3717
+ <xsl:value-of select="$parent_table_page-width"/>
3718
+ </xsl:when>
3719
+ <xsl:otherwise>
3720
+ <xsl:value-of select="@page-width"/>
3721
+ </xsl:otherwise>
3663
3722
  </xsl:choose>
3664
3723
  </xsl:variable>
3665
3724
 
@@ -3667,9 +3726,6 @@
3667
3726
  <table_width>
3668
3727
  <xsl:copy-of select="$table_widths"/>
3669
3728
  </table_width>
3670
- <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug>
3671
- <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug>
3672
- -->
3673
3729
  <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
3674
3730
  </xsl:if>
3675
3731
 
@@ -3680,11 +3736,11 @@
3680
3736
  <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
3681
3737
  <!-- call old algorithm -->
3682
3738
  <case1/>
3683
- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
3739
+ <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
3684
3740
  <xsl:call-template name="calculate-column-widths-proportional">
3685
3741
  <xsl:with-param name="cols-count" select="$cols-count"/>
3686
3742
  <xsl:with-param name="table" select="$table"/>
3687
- </xsl:call-template>
3743
+ </xsl:call-template> -->
3688
3744
  </xsl:when>
3689
3745
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
3690
3746
  <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
@@ -3728,95 +3784,49 @@
3728
3784
  <xsl:otherwise><unknown_case/></xsl:otherwise>
3729
3785
  </xsl:choose>
3730
3786
 
3787
+ </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm">
3731
3788
 
3732
- </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths">
3733
- <xsl:copy>
3734
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/>
3735
- </xsl:copy>
3736
- </xsl:template><xsl:template match="td | th" mode="determine_cell_widths">
3737
- <xsl:copy>
3738
- <xsl:copy-of select="@*"/>
3789
+ <!-- if nested 'dl' or 'table' -->
3790
+ <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/>
3791
+ <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id>
3739
3792
 
3740
- <!-- The maximum width is given by the widest line. -->
3741
- <xsl:variable name="widths_max">
3742
- <xsl:for-each select=".//*[local-name() = 'p']">
3743
- <xsl:call-template name="add_width"/>
3744
- </xsl:for-each>
3745
- <xsl:if test="not(*[local-name() = 'p'])">
3746
- <xsl:call-template name="add_width"/>
3747
- </xsl:if>
3748
- </xsl:variable>
3749
- <xsl:variable name="width_max">
3750
- <xsl:for-each select="xalan:nodeset($widths_max)//width">
3751
- <xsl:sort select="." data-type="number" order="descending"/>
3752
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3753
- </xsl:for-each>
3754
- </xsl:variable>
3755
- <xsl:attribute name="width_max">
3756
- <xsl:value-of select="$width_max"/>
3757
- </xsl:attribute>
3793
+ <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
3758
3794
 
3759
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
3760
- <!-- To do: image width -->
3761
- <xsl:variable name="td_text">
3762
- <xsl:apply-templates select="." mode="td_text"/>
3763
- </xsl:variable>
3764
- <xsl:variable name="words">
3765
- <xsl:variable name="string_with_added_zerospaces">
3766
- <xsl:call-template name="add-zero-spaces-java">
3767
- <xsl:with-param name="text" select="$td_text"/>
3768
- </xsl:call-template>
3795
+ <xsl:variable name="parent_table_page-width_">
3796
+ <xsl:if test="$parent_table_id != ''">
3797
+ <!-- determine column number in the parent table -->
3798
+ <xsl:variable name="parent_table_column_number">
3799
+ <xsl:choose>
3800
+ <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
3801
+ <xsl:otherwise> <!-- parent is table -->
3802
+ <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
3803
+ </xsl:otherwise>
3804
+ </xsl:choose>
3769
3805
  </xsl:variable>
3770
- <xsl:call-template name="tokenize">
3771
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
3772
- </xsl:call-template>
3773
- </xsl:variable>
3774
-
3775
- <xsl:variable name="max_word_length">
3776
- <xsl:call-template name="max_length">
3777
- <xsl:with-param name="words" select="xalan:nodeset($words)"/>
3778
- </xsl:call-template>
3779
- </xsl:variable>
3780
- <xsl:variable name="width_min">
3781
- <xsl:value-of select="$max_word_length"/>
3782
- </xsl:variable>
3783
- <xsl:attribute name="width_min">
3784
- <xsl:value-of select="$width_min"/>
3785
- </xsl:attribute>
3786
- <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals -->
3787
- <xsl:if test="$width_min &gt; $width_max">
3788
- <xsl:attribute name="width_max">
3789
- <xsl:value-of select="$width_min"/>
3790
- </xsl:attribute>
3806
+ <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
3807
+ <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
3791
3808
  </xsl:if>
3792
- <xsl:if test="$width_min = 0">
3793
- <xsl:attribute name="width_min">1</xsl:attribute>
3794
- </xsl:if>
3795
-
3796
- <xsl:apply-templates select="node()" mode="determine_cell_widths"/>
3797
-
3798
- </xsl:copy>
3799
- </xsl:template><xsl:template name="add_width">
3800
- <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable>
3801
- <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/>
3802
-
3803
- <xsl:variable name="p_text_len">
3804
- <xsl:choose>
3805
- <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters -->
3806
- <xsl:value-of select="$p_text_len_ * 1.5"/>
3807
- </xsl:when>
3808
- <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise>
3809
- </xsl:choose>
3810
3809
  </xsl:variable>
3810
+ <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
3811
3811
 
3812
- <xsl:variable name="math_addon_text">
3813
- <xsl:for-each select=".//*[local-name() = 'math']">
3814
- <xsl:apply-templates mode="td_text"/>
3815
- </xsl:for-each>
3816
- </xsl:variable>
3817
- <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% -->
3812
+ <!-- get current table id -->
3813
+ <xsl:variable name="table_id" select="@id"/>
3814
+
3815
+ <xsl:choose>
3816
+ <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''">
3817
+ <!-- find table by id in the file 'table_widths' and get all `<column>...</column> -->
3818
+ <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/>
3819
+ </xsl:when>
3820
+ <xsl:otherwise>
3821
+ <!-- recalculate columns width based on parent table width -->
3822
+ <xsl:for-each select="$table_widths_from_if//table[@id = $table_id]">
3823
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm">
3824
+ <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000-->
3825
+ </xsl:call-template>
3826
+ </xsl:for-each>
3827
+ </xsl:otherwise>
3828
+ </xsl:choose>
3818
3829
 
3819
- <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width>
3820
3830
  </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
3821
3831
  <xsl:copy>
3822
3832
  <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
@@ -4610,11 +4620,19 @@
4610
4620
 
4611
4621
 
4612
4622
 
4623
+
4624
+ <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
4625
+ <xsl:attribute name="margin-top">0</xsl:attribute>
4626
+ </xsl:if>
4627
+
4613
4628
  <fo:block>
4614
4629
 
4615
4630
 
4616
4631
 
4617
4632
 
4633
+ <xsl:apply-templates select="*[local-name() = 'name']">
4634
+ <xsl:with-param name="process">true</xsl:with-param>
4635
+ </xsl:apply-templates>
4618
4636
 
4619
4637
  <xsl:if test="$isGenerateTableIF = 'true'">
4620
4638
  <!-- to determine start of table -->
@@ -4637,6 +4655,7 @@
4637
4655
  </xsl:choose>
4638
4656
 
4639
4657
 
4658
+
4640
4659
  <xsl:choose>
4641
4660
  <xsl:when test="$isGenerateTableIF = 'true'">
4642
4661
  <!-- generate IF for table widths -->
@@ -4765,6 +4784,18 @@
4765
4784
  </xsl:if> <!-- END: a few components -->
4766
4785
  </fo:block-container>
4767
4786
  </fo:block-container>
4787
+
4788
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' -->
4789
+ <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/>
4790
+ </xsl:if>
4791
+
4792
+ </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
4793
+ <xsl:param name="process">false</xsl:param>
4794
+ <xsl:if test="$process = 'true'">
4795
+ <fo:block xsl:use-attribute-sets="dl-name-style">
4796
+ <xsl:apply-templates/>
4797
+ </fo:block>
4798
+ </xsl:if>
4768
4799
  </xsl:template><xsl:template name="setColumnWidth_dl">
4769
4800
  <xsl:param name="colwidths"/>
4770
4801
  <xsl:param name="maxlength_dt"/>
@@ -4773,6 +4804,11 @@
4773
4804
  <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
4774
4805
 
4775
4806
  <xsl:choose>
4807
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
4808
+ <xsl:call-template name="insertTableColumnWidth">
4809
+ <xsl:with-param name="colwidths" select="$colwidths"/>
4810
+ </xsl:call-template>
4811
+ </xsl:when>
4776
4812
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
4777
4813
  <fo:table-column column-width="50%"/>
4778
4814
  <fo:table-column column-width="50%"/>
@@ -5025,12 +5061,24 @@
5025
5061
  </td>
5026
5062
  <td>
5027
5063
 
5028
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/>
5064
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5065
+
5066
+ <!-- get paragraphs from nested 'dl' -->
5067
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5068
+
5029
5069
 
5030
5070
  </td>
5031
5071
  </tr>
5032
5072
 
5033
- </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']">
5073
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
5074
+ <xsl:for-each select="*[local-name() = 'dt']">
5075
+ <p>
5076
+ <xsl:copy-of select="node()"/>
5077
+ <xsl:text> </xsl:text>
5078
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/>
5079
+ </p>
5080
+ </xsl:for-each>
5081
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']">
5034
5082
  <fo:inline font-style="italic">
5035
5083
  <xsl:apply-templates/>
5036
5084
  </fo:inline>
@@ -5061,7 +5109,7 @@
5061
5109
 
5062
5110
 
5063
5111
 
5064
-
5112
+ <!-- 10 -->
5065
5113
 
5066
5114
 
5067
5115
 
@@ -7108,7 +7156,7 @@
7108
7156
 
7109
7157
 
7110
7158
 
7111
-
7159
+ <!-- 9 -->
7112
7160
 
7113
7161
 
7114
7162
 
@@ -7200,7 +7248,7 @@
7200
7248
  <xsl:for-each select="xalan:nodeset($text_step4)/node()">
7201
7249
  <xsl:choose>
7202
7250
  <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
7203
- <xsl:call-template name="interspers">
7251
+ <xsl:call-template name="interspers-java">
7204
7252
  <xsl:with-param name="str" select="."/>
7205
7253
  </xsl:call-template>
7206
7254
  </xsl:when>
@@ -7250,6 +7298,10 @@
7250
7298
  <xsl:with-param name="char" select="$char"/>
7251
7299
  </xsl:call-template>
7252
7300
  </xsl:if>
7301
+ </xsl:template><xsl:template name="interspers-java">
7302
+ <xsl:param name="str"/>
7303
+ <xsl:param name="char" select="$zero_width_space"/>
7304
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. -->
7253
7305
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
7254
7306
  <xsl:apply-templates mode="syntax_highlight"/>
7255
7307
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -8208,6 +8260,11 @@
8208
8260
  </xsl:otherwise>
8209
8261
  </xsl:choose>
8210
8262
  </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
8263
+
8264
+ <xsl:apply-templates select="*[local-name() = 'name']">
8265
+ <xsl:with-param name="process">true</xsl:with-param>
8266
+ </xsl:apply-templates>
8267
+
8211
8268
  <fo:list-block xsl:use-attribute-sets="list-style">
8212
8269
 
8213
8270
 
@@ -8218,12 +8275,23 @@
8218
8275
 
8219
8276
 
8220
8277
 
8278
+ <xsl:if test="*[local-name() = 'name']">
8279
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
8280
+ </xsl:if>
8281
+
8221
8282
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
8222
8283
  </fo:list-block>
8223
8284
  <!-- <xsl:for-each select="./iho:note">
8224
8285
  <xsl:call-template name="note"/>
8225
8286
  </xsl:for-each> -->
8226
8287
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
8288
+ </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
8289
+ <xsl:param name="process">false</xsl:param>
8290
+ <xsl:if test="$process = 'true'">
8291
+ <fo:block xsl:use-attribute-sets="list-name-style">
8292
+ <xsl:apply-templates/>
8293
+ </fo:block>
8294
+ </xsl:if>
8227
8295
  </xsl:template><xsl:template match="*[local-name()='li']">
8228
8296
  <fo:list-item xsl:use-attribute-sets="list-item-style">
8229
8297
  <xsl:copy-of select="@id"/>
@@ -8532,145 +8600,7 @@
8532
8600
  <xsl:if test=".//ogc:fn">
8533
8601
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
8534
8602
  </xsl:if>
8535
- <xsl:choose>
8536
- <xsl:when test="*[local-name() = 'formattedref']">
8537
- <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
8538
- </xsl:when>
8539
- <xsl:otherwise>
8540
- <xsl:variable name="personalAuthors">
8541
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person']">
8542
- <xsl:call-template name="processPersonalAuthor"/>
8543
- </xsl:for-each>
8544
- <xsl:if test="not(*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person'])">
8545
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']/*[local-name() = 'person']">
8546
- <xsl:call-template name="processPersonalAuthor"/>
8547
- </xsl:for-each>
8548
- </xsl:if>
8549
- </xsl:variable>
8550
-
8551
- <xsl:variable name="city" select="*[local-name() = 'place']"/>
8552
- <xsl:variable name="year">
8553
- <xsl:choose>
8554
- <xsl:when test="*[local-name() = 'date'][@type = 'published']">
8555
- <xsl:for-each select="*[local-name() = 'date'][@type = 'published']">
8556
- <xsl:call-template name="renderDate"/>
8557
- </xsl:for-each>
8558
- </xsl:when>
8559
- <xsl:when test="*[local-name() = 'date'][@type = 'issued']">
8560
- <xsl:for-each select="*[local-name() = 'date'][@type = 'issued']">
8561
- <xsl:call-template name="renderDate"/>
8562
- </xsl:for-each>
8563
- </xsl:when>
8564
- <xsl:when test="*[local-name() = 'date'][@type = 'circulated']">
8565
- <xsl:for-each select="*[local-name() = 'date'][@type = 'circulated']">
8566
- <xsl:call-template name="renderDate"/>
8567
- </xsl:for-each>
8568
- </xsl:when>
8569
- <xsl:otherwise>
8570
- <xsl:for-each select="*[local-name() = 'date']">
8571
- <xsl:call-template name="renderDate"/>
8572
- </xsl:for-each>
8573
- </xsl:otherwise>
8574
- </xsl:choose>
8575
- </xsl:variable>
8576
-
8577
- <xsl:variable name="uri" select="*[local-name() = 'uri']"/>
8578
-
8579
-
8580
- <!-- citation structure:
8581
- {personal names | organisation}: {document identifier}, {title}. {publisher}, {city} ({year})
8582
- -->
8583
-
8584
- <!-- Author(s) -->
8585
- <xsl:choose>
8586
- <xsl:when test="xalan:nodeset($personalAuthors)//author">
8587
- <xsl:for-each select="xalan:nodeset($personalAuthors)//author">
8588
- <xsl:apply-templates/>
8589
- <xsl:if test="position() != last()">, </xsl:if>
8590
- </xsl:for-each>
8591
- <xsl:text>: </xsl:text>
8592
- </xsl:when>
8593
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
8594
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
8595
- <xsl:value-of select="."/>
8596
- <xsl:if test="position() != last()">/</xsl:if>
8597
- </xsl:for-each>
8598
- <xsl:text>: </xsl:text>
8599
- </xsl:when>
8600
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
8601
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
8602
- <xsl:value-of select="."/>
8603
- <xsl:if test="position() != last()">, </xsl:if>
8604
- </xsl:for-each>
8605
- <xsl:text>: </xsl:text>
8606
- </xsl:when>
8607
- </xsl:choose>
8608
-
8609
-
8610
- <xsl:variable name="document_identifier">
8611
- <xsl:call-template name="processBibitemDocId"/>
8612
- </xsl:variable>
8613
-
8614
- <xsl:value-of select="$document_identifier"/>
8615
-
8616
- <xsl:apply-templates select="*[local-name() = 'note']"/>
8617
-
8618
- <xsl:variable name="isDraft">
8619
- <xsl:variable name="stage" select="normalize-space(*[local-name() = 'status']/*[local-name() = 'stage'])"/>
8620
- <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization'][*[local-name() = 'name']/text() = 'Open Geospatial Consortium'] and $stage != '' and $stage != 'published' and $stage != 'deprecated' and $stage != 'retired'">true</xsl:if>
8621
- </xsl:variable>
8622
-
8623
- <xsl:if test="$isDraft = 'true'">
8624
- <xsl:text> (Draft)</xsl:text>
8625
- </xsl:if>
8626
-
8627
- <xsl:text>, </xsl:text>
8628
-
8629
- <xsl:choose>
8630
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
8631
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
8632
- </xsl:when>
8633
- <xsl:otherwise>
8634
- <xsl:apply-templates select="*[local-name() = 'title']"/>
8635
- </xsl:otherwise>
8636
- </xsl:choose>
8637
-
8638
- <xsl:text>. </xsl:text>
8639
-
8640
- <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
8641
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
8642
- <xsl:value-of select="."/>
8643
- <xsl:if test="position() != last()">, </xsl:if>
8644
- </xsl:for-each>
8645
- <xsl:if test="normalize-space($city) != ''">, </xsl:if>
8646
- </xsl:if>
8647
-
8648
- <xsl:value-of select="$city"/>
8649
-
8650
- <xsl:if test="(*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name'] or normalize-space($city) != '') and normalize-space($year) != ''">
8651
- <xsl:text> </xsl:text>
8652
- </xsl:if>
8653
-
8654
- <xsl:if test="normalize-space($year) != ''">
8655
- <xsl:text>(</xsl:text>
8656
- <xsl:value-of select="$year"/>
8657
- <xsl:text>). </xsl:text>
8658
- </xsl:if>
8659
-
8660
- <xsl:if test="normalize-space($uri) != ''">
8661
- <fo:inline>
8662
-
8663
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
8664
-
8665
- <xsl:text> </xsl:text>
8666
- <fo:basic-link external-destination="{$uri}" fox:alt-text="{$uri}">
8667
- <xsl:value-of select="$uri"/>
8668
- </fo:basic-link>
8669
- </fo:inline>
8670
- </xsl:if>
8671
-
8672
- </xsl:otherwise>
8673
- </xsl:choose>
8603
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
8674
8604
  <!-- end OGC bibitem processing-->
8675
8605
 
8676
8606
  </xsl:template><xsl:template name="processBibitemDocId">
@@ -8998,25 +8928,32 @@
8998
8928
  </fo:block-container>
8999
8929
 
9000
8930
  </xsl:template><xsl:template name="displayAdmonitionName">
9001
-
8931
+ <xsl:param name="sep"/> <!-- Example: ' - ' -->
8932
+ <!-- <xsl:choose>
8933
+ <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
8934
+ <xsl:choose>
8935
+ <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when>
8936
+ <xsl:otherwise>
8937
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8938
+ </xsl:otherwise>
8939
+ </xsl:choose>
8940
+ </xsl:when>
8941
+ <xsl:otherwise>
9002
8942
  <xsl:apply-templates select="*[local-name() = 'name']"/>
9003
8943
  <xsl:if test="not(*[local-name() = 'name'])">
9004
8944
  <xsl:apply-templates select="@type"/>
9005
8945
  </xsl:if>
9006
-
9007
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
9008
- <xsl:apply-templates/>
9009
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
9010
- <xsl:variable name="admonition_type_">
9011
- <xsl:call-template name="getLocalizedString">
9012
- <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
9013
- </xsl:call-template>
8946
+ </xsl:otherwise>
8947
+ </xsl:choose> -->
8948
+ <xsl:variable name="name">
8949
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
9014
8950
  </xsl:variable>
9015
- <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
9016
- <xsl:value-of select="$admonition_type"/>
9017
- <xsl:if test="$admonition_type = ''">
9018
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
8951
+ <xsl:copy-of select="$name"/>
8952
+ <xsl:if test="normalize-space($name) != ''">
8953
+ <xsl:value-of select="$sep"/>
9019
8954
  </xsl:if>
8955
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
8956
+ <xsl:apply-templates/>
9020
8957
  </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
9021
8958
 
9022
8959
  <fo:block xsl:use-attribute-sets="admonition-p-style">