metanorma-ogc 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -252,7 +252,7 @@
252
252
 
253
253
 
254
254
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
255
- <xsl:for-each select="/*/*[local-name()='preface']/*">
255
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
256
256
  <xsl:sort select="@displayorder" data-type="number"/>
257
257
 
258
258
  <xsl:if test="local-name() = 'abstract' or local-name() = 'foreword' or local-name() = 'introduction'">
@@ -643,14 +643,41 @@
643
643
  </xsl:choose>
644
644
  </xsl:template>
645
645
 
646
- <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_">
646
+ <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_">
647
+ <xsl:for-each select="$table_widths_from_if//table">
648
+ <xsl:copy>
649
+ <xsl:copy-of select="@*"/>
650
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/>
651
+ </xsl:copy>
652
+ </xsl:for-each>
653
+ </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_">
647
654
  false
648
655
  </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
649
656
  <xsl:call-template name="getLang"/>
650
- </xsl:variable><xsl:variable name="pageWidth_">
651
- 215.9
657
+ </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_">
658
+ <xsl:choose>
659
+ <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
660
+ <xsl:when test="$papersize = 'a4'">210</xsl:when>
661
+ </xsl:choose>
662
+ </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_">
663
+ <xsl:choose>
664
+ <xsl:when test="$papersize = 'letter'">279.4</xsl:when>
665
+ <xsl:when test="$papersize = 'a4'">297</xsl:when>
666
+ </xsl:choose>
667
+ </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_">
668
+ <xsl:choose>
669
+ <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when>
670
+ <xsl:otherwise>
671
+ 215.9
672
+ </xsl:otherwise>
673
+ </xsl:choose>
652
674
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
653
- 279.4
675
+ <xsl:choose>
676
+ <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when>
677
+ <xsl:otherwise>
678
+ 279.4
679
+ </xsl:otherwise>
680
+ </xsl:choose>
654
681
  </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
655
682
  25.4
656
683
  </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
@@ -1302,6 +1329,26 @@
1302
1329
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1303
1330
 
1304
1331
 
1332
+ </xsl:attribute-set><xsl:attribute-set name="dl-name-style">
1333
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1334
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1335
+
1336
+
1337
+
1338
+
1339
+
1340
+
1341
+
1342
+
1343
+
1344
+ <xsl:attribute name="color">rgb(68, 84, 106)</xsl:attribute>
1345
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1305
1352
  </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
1306
1353
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
1307
1354
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
@@ -1642,6 +1689,25 @@
1642
1689
 
1643
1690
 
1644
1691
 
1692
+ </xsl:attribute-set><xsl:attribute-set name="list-name-style">
1693
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1694
+
1695
+
1696
+
1697
+
1698
+
1699
+
1700
+
1701
+
1702
+
1703
+ <xsl:attribute name="color">rgb(68, 84, 106)</xsl:attribute>
1704
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1705
+
1706
+
1707
+
1708
+
1709
+
1710
+
1645
1711
  </xsl:attribute-set><xsl:attribute-set name="list-item-style">
1646
1712
 
1647
1713
 
@@ -2055,13 +2121,13 @@
2055
2121
 
2056
2122
  </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">
2057
2123
  <xsl:variable name="nodes_preface_">
2058
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2124
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2059
2125
  <node id="{@id}"/>
2060
2126
  </xsl:for-each>
2061
2127
  </xsl:variable>
2062
2128
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2063
2129
 
2064
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2130
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2065
2131
  <xsl:sort select="@displayorder" data-type="number"/>
2066
2132
 
2067
2133
  <!-- process Section's title -->
@@ -2127,7 +2193,7 @@
2127
2193
  </xsl:for-each>
2128
2194
  </figures>
2129
2195
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2130
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2196
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2131
2197
  <xsl:sort select="@displayorder" data-type="number"/>
2132
2198
  <xsl:apply-templates select="."/>
2133
2199
  </xsl:for-each>
@@ -2777,8 +2843,9 @@
2777
2843
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2778
2844
  </xsl:if>
2779
2845
  </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
2780
- <xsl:param name="table"/>
2781
- <xsl:param name="if">false</xsl:param> <!-- via intermediate format -->
2846
+ <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
2847
+
2848
+ <!-- via intermediate format -->
2782
2849
 
2783
2850
  <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
2784
2851
 
@@ -2789,9 +2856,8 @@
2789
2856
  <!-- get current table id -->
2790
2857
  <xsl:variable name="table_id" select="@id"/>
2791
2858
  <!-- find table by id in the file 'table_widths' -->
2792
- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2793
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/>
2794
-
2859
+ <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2860
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
2795
2861
 
2796
2862
  <!-- table='<xsl:copy-of select="$table"/>' -->
2797
2863
  <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
@@ -2799,24 +2865,13 @@
2799
2865
  <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2800
2866
 
2801
2867
  <xsl:variable name="table_with_cell_widths_">
2802
- <xsl:choose>
2803
- <xsl:when test="$if = 'true' and normalize-space($table-if) != ''"> <!-- if we read column's width from IF and there is table in IF -->
2804
-
2805
- <!-- Example: <column>10</column>
2806
- <column>11</column>
2807
- -->
2808
- <xsl:apply-templates select="$table-if" mode="determine_cell_widths-if"/>
2809
- </xsl:when>
2810
- <xsl:otherwise>
2811
- <xsl:apply-templates select="xalan:nodeset($table)" mode="determine_cell_widths"/>
2812
- </xsl:otherwise>
2813
- </xsl:choose>
2868
+ <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
2814
2869
  </xsl:variable>
2815
2870
  <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2816
2871
 
2817
- <xsl:if test="$table_if_debug = 'true'">
2872
+ <!-- <xsl:if test="$table_if_debug = 'true'">
2818
2873
  <xsl:copy-of select="$table_with_cell_widths"/>
2819
- </xsl:if>
2874
+ </xsl:if> -->
2820
2875
 
2821
2876
 
2822
2877
  <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
@@ -2862,8 +2917,12 @@
2862
2917
 
2863
2918
  <xsl:variable name="page_width">
2864
2919
  <xsl:choose>
2865
- <xsl:when test="$if = 'true'"><xsl:value-of select="$table-if/@page-width"/></xsl:when>
2866
- <xsl:otherwise>75</xsl:otherwise>
2920
+ <xsl:when test="$parent_table_page-width != ''">
2921
+ <xsl:value-of select="$parent_table_page-width"/>
2922
+ </xsl:when>
2923
+ <xsl:otherwise>
2924
+ <xsl:value-of select="@page-width"/>
2925
+ </xsl:otherwise>
2867
2926
  </xsl:choose>
2868
2927
  </xsl:variable>
2869
2928
 
@@ -2871,9 +2930,6 @@
2871
2930
  <table_width>
2872
2931
  <xsl:copy-of select="$table_widths"/>
2873
2932
  </table_width>
2874
- <!-- <debug>$table_widths/@width_min=<xsl:value-of select="$table_widths/table/@width_min"/></debug>
2875
- <debug>$table_widths/@width_max=<xsl:value-of select="$table_widths/table/@width_max"/></debug>
2876
- -->
2877
2933
  <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2878
2934
  </xsl:if>
2879
2935
 
@@ -2884,11 +2940,11 @@
2884
2940
  <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2885
2941
  <!-- call old algorithm -->
2886
2942
  <case1/>
2887
- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
2943
+ <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
2888
2944
  <xsl:call-template name="calculate-column-widths-proportional">
2889
2945
  <xsl:with-param name="cols-count" select="$cols-count"/>
2890
2946
  <xsl:with-param name="table" select="$table"/>
2891
- </xsl:call-template>
2947
+ </xsl:call-template> -->
2892
2948
  </xsl:when>
2893
2949
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2894
2950
  <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
@@ -2932,95 +2988,49 @@
2932
2988
  <xsl:otherwise><unknown_case/></xsl:otherwise>
2933
2989
  </xsl:choose>
2934
2990
 
2991
+ </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm">
2935
2992
 
2936
- </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths">
2937
- <xsl:copy>
2938
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths"/>
2939
- </xsl:copy>
2940
- </xsl:template><xsl:template match="td | th" mode="determine_cell_widths">
2941
- <xsl:copy>
2942
- <xsl:copy-of select="@*"/>
2993
+ <!-- if nested 'dl' or 'table' -->
2994
+ <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/>
2995
+ <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id>
2943
2996
 
2944
- <!-- The maximum width is given by the widest line. -->
2945
- <xsl:variable name="widths_max">
2946
- <xsl:for-each select=".//*[local-name() = 'p']">
2947
- <xsl:call-template name="add_width"/>
2948
- </xsl:for-each>
2949
- <xsl:if test="not(*[local-name() = 'p'])">
2950
- <xsl:call-template name="add_width"/>
2951
- </xsl:if>
2952
- </xsl:variable>
2953
- <xsl:variable name="width_max">
2954
- <xsl:for-each select="xalan:nodeset($widths_max)//width">
2955
- <xsl:sort select="." data-type="number" order="descending"/>
2956
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2957
- </xsl:for-each>
2958
- </xsl:variable>
2959
- <xsl:attribute name="width_max">
2960
- <xsl:value-of select="$width_max"/>
2961
- </xsl:attribute>
2997
+ <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
2962
2998
 
2963
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2964
- <!-- To do: image width -->
2965
- <xsl:variable name="td_text">
2966
- <xsl:apply-templates select="." mode="td_text"/>
2967
- </xsl:variable>
2968
- <xsl:variable name="words">
2969
- <xsl:variable name="string_with_added_zerospaces">
2970
- <xsl:call-template name="add-zero-spaces-java">
2971
- <xsl:with-param name="text" select="$td_text"/>
2972
- </xsl:call-template>
2999
+ <xsl:variable name="parent_table_page-width_">
3000
+ <xsl:if test="$parent_table_id != ''">
3001
+ <!-- determine column number in the parent table -->
3002
+ <xsl:variable name="parent_table_column_number">
3003
+ <xsl:choose>
3004
+ <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
3005
+ <xsl:otherwise> <!-- parent is table -->
3006
+ <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
3007
+ </xsl:otherwise>
3008
+ </xsl:choose>
2973
3009
  </xsl:variable>
2974
- <xsl:call-template name="tokenize">
2975
- <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2976
- </xsl:call-template>
2977
- </xsl:variable>
2978
-
2979
- <xsl:variable name="max_word_length">
2980
- <xsl:call-template name="max_length">
2981
- <xsl:with-param name="words" select="xalan:nodeset($words)"/>
2982
- </xsl:call-template>
2983
- </xsl:variable>
2984
- <xsl:variable name="width_min">
2985
- <xsl:value-of select="$max_word_length"/>
2986
- </xsl:variable>
2987
- <xsl:attribute name="width_min">
2988
- <xsl:value-of select="$width_min"/>
2989
- </xsl:attribute>
2990
- <!-- width_max="1" width_min="1.5"> --> <!-- see 'tokenize' template, multiply 1.5 for all latin capitals -->
2991
- <xsl:if test="$width_min &gt; $width_max">
2992
- <xsl:attribute name="width_max">
2993
- <xsl:value-of select="$width_min"/>
2994
- </xsl:attribute>
3010
+ <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
3011
+ <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2995
3012
  </xsl:if>
2996
- <xsl:if test="$width_min = 0">
2997
- <xsl:attribute name="width_min">1</xsl:attribute>
2998
- </xsl:if>
2999
-
3000
- <xsl:apply-templates select="node()" mode="determine_cell_widths"/>
3001
-
3002
- </xsl:copy>
3003
- </xsl:template><xsl:template name="add_width">
3004
- <xsl:variable name="p_text"><xsl:apply-templates select="." mode="td_text"/></xsl:variable>
3005
- <xsl:variable name="p_text_len_" select="string-length(normalize-space($p_text))"/>
3006
-
3007
- <xsl:variable name="p_text_len">
3008
- <xsl:choose>
3009
- <xsl:when test="normalize-space(translate($p_text, concat($upper,'0123456789'), '')) = ''"> <!-- english word in CAPITAL letters -->
3010
- <xsl:value-of select="$p_text_len_ * 1.5"/>
3011
- </xsl:when>
3012
- <xsl:otherwise><xsl:value-of select="$p_text_len_"/></xsl:otherwise>
3013
- </xsl:choose>
3014
3013
  </xsl:variable>
3014
+ <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
3015
3015
 
3016
- <xsl:variable name="math_addon_text">
3017
- <xsl:for-each select=".//*[local-name() = 'math']">
3018
- <xsl:apply-templates mode="td_text"/>
3019
- </xsl:for-each>
3020
- </xsl:variable>
3021
- <xsl:variable name="math_addon_length" select="string-length(normalize-space($math_addon_text)) * 0.2"/> <!-- plus 20% -->
3016
+ <!-- get current table id -->
3017
+ <xsl:variable name="table_id" select="@id"/>
3018
+
3019
+ <xsl:choose>
3020
+ <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''">
3021
+ <!-- find table by id in the file 'table_widths' and get all `<column>...</column> -->
3022
+ <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/>
3023
+ </xsl:when>
3024
+ <xsl:otherwise>
3025
+ <!-- recalculate columns width based on parent table width -->
3026
+ <xsl:for-each select="$table_widths_from_if//table[@id = $table_id]">
3027
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm">
3028
+ <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000-->
3029
+ </xsl:call-template>
3030
+ </xsl:for-each>
3031
+ </xsl:otherwise>
3032
+ </xsl:choose>
3022
3033
 
3023
- <width><xsl:value-of select="$p_text_len + $math_addon_length"/></width>
3024
3034
  </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
3025
3035
  <xsl:copy>
3026
3036
  <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
@@ -3809,11 +3819,19 @@
3809
3819
 
3810
3820
 
3811
3821
 
3822
+
3823
+ <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
3824
+ <xsl:attribute name="margin-top">0</xsl:attribute>
3825
+ </xsl:if>
3826
+
3812
3827
  <fo:block>
3813
3828
 
3814
3829
 
3815
3830
 
3816
3831
 
3832
+ <xsl:apply-templates select="*[local-name() = 'name']">
3833
+ <xsl:with-param name="process">true</xsl:with-param>
3834
+ </xsl:apply-templates>
3817
3835
 
3818
3836
  <xsl:if test="$isGenerateTableIF = 'true'">
3819
3837
  <!-- to determine start of table -->
@@ -3836,6 +3854,7 @@
3836
3854
  </xsl:choose>
3837
3855
 
3838
3856
 
3857
+
3839
3858
  <xsl:choose>
3840
3859
  <xsl:when test="$isGenerateTableIF = 'true'">
3841
3860
  <!-- generate IF for table widths -->
@@ -3964,6 +3983,18 @@
3964
3983
  </xsl:if> <!-- END: a few components -->
3965
3984
  </fo:block-container>
3966
3985
  </fo:block-container>
3986
+
3987
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' -->
3988
+ <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/>
3989
+ </xsl:if>
3990
+
3991
+ </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
3992
+ <xsl:param name="process">false</xsl:param>
3993
+ <xsl:if test="$process = 'true'">
3994
+ <fo:block xsl:use-attribute-sets="dl-name-style">
3995
+ <xsl:apply-templates/>
3996
+ </fo:block>
3997
+ </xsl:if>
3967
3998
  </xsl:template><xsl:template name="setColumnWidth_dl">
3968
3999
  <xsl:param name="colwidths"/>
3969
4000
  <xsl:param name="maxlength_dt"/>
@@ -3972,6 +4003,11 @@
3972
4003
  <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
3973
4004
 
3974
4005
  <xsl:choose>
4006
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
4007
+ <xsl:call-template name="insertTableColumnWidth">
4008
+ <xsl:with-param name="colwidths" select="$colwidths"/>
4009
+ </xsl:call-template>
4010
+ </xsl:when>
3975
4011
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3976
4012
  <fo:table-column column-width="50%"/>
3977
4013
  <fo:table-column column-width="50%"/>
@@ -4224,12 +4260,24 @@
4224
4260
  </td>
4225
4261
  <td>
4226
4262
 
4227
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()"/>
4263
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4264
+
4265
+ <!-- get paragraphs from nested 'dl' -->
4266
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4267
+
4228
4268
 
4229
4269
  </td>
4230
4270
  </tr>
4231
4271
 
4232
- </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='em']">
4272
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
4273
+ <xsl:for-each select="*[local-name() = 'dt']">
4274
+ <p>
4275
+ <xsl:copy-of select="node()"/>
4276
+ <xsl:text> </xsl:text>
4277
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/>
4278
+ </p>
4279
+ </xsl:for-each>
4280
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']">
4233
4281
  <fo:inline font-style="italic">
4234
4282
  <xsl:apply-templates/>
4235
4283
  </fo:inline>
@@ -4260,7 +4308,7 @@
4260
4308
 
4261
4309
 
4262
4310
 
4263
-
4311
+ <!-- 10 -->
4264
4312
 
4265
4313
 
4266
4314
 
@@ -6275,7 +6323,7 @@
6275
6323
 
6276
6324
 
6277
6325
 
6278
-
6326
+ <!-- 9 -->
6279
6327
 
6280
6328
 
6281
6329
 
@@ -6359,7 +6407,7 @@
6359
6407
  <xsl:for-each select="xalan:nodeset($text_step4)/node()">
6360
6408
  <xsl:choose>
6361
6409
  <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6362
- <xsl:call-template name="interspers">
6410
+ <xsl:call-template name="interspers-java">
6363
6411
  <xsl:with-param name="str" select="."/>
6364
6412
  </xsl:call-template>
6365
6413
  </xsl:when>
@@ -6409,6 +6457,10 @@
6409
6457
  <xsl:with-param name="char" select="$char"/>
6410
6458
  </xsl:call-template>
6411
6459
  </xsl:if>
6460
+ </xsl:template><xsl:template name="interspers-java">
6461
+ <xsl:param name="str"/>
6462
+ <xsl:param name="char" select="$zero_width_space"/>
6463
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. -->
6412
6464
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6413
6465
  <xsl:apply-templates mode="syntax_highlight"/>
6414
6466
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -7379,6 +7431,11 @@
7379
7431
  </xsl:otherwise>
7380
7432
  </xsl:choose>
7381
7433
  </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
7434
+
7435
+ <xsl:apply-templates select="*[local-name() = 'name']">
7436
+ <xsl:with-param name="process">true</xsl:with-param>
7437
+ </xsl:apply-templates>
7438
+
7382
7439
  <fo:list-block xsl:use-attribute-sets="list-style">
7383
7440
 
7384
7441
 
@@ -7389,12 +7446,23 @@
7389
7446
 
7390
7447
 
7391
7448
 
7449
+ <xsl:if test="*[local-name() = 'name']">
7450
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7451
+ </xsl:if>
7452
+
7392
7453
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
7393
7454
  </fo:list-block>
7394
7455
  <!-- <xsl:for-each select="./iho:note">
7395
7456
  <xsl:call-template name="note"/>
7396
7457
  </xsl:for-each> -->
7397
7458
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
7459
+ </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
7460
+ <xsl:param name="process">false</xsl:param>
7461
+ <xsl:if test="$process = 'true'">
7462
+ <fo:block xsl:use-attribute-sets="list-name-style">
7463
+ <xsl:apply-templates/>
7464
+ </fo:block>
7465
+ </xsl:if>
7398
7466
  </xsl:template><xsl:template match="*[local-name()='li']">
7399
7467
  <fo:list-item xsl:use-attribute-sets="list-item-style">
7400
7468
  <xsl:copy-of select="@id"/>
@@ -7698,143 +7766,7 @@
7698
7766
  <xsl:if test=".//ogc:fn">
7699
7767
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
7700
7768
  </xsl:if>
7701
- <xsl:choose>
7702
- <xsl:when test="*[local-name() = 'formattedref']">
7703
- <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
7704
- </xsl:when>
7705
- <xsl:otherwise>
7706
- <xsl:variable name="personalAuthors">
7707
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person']">
7708
- <xsl:call-template name="processPersonalAuthor"/>
7709
- </xsl:for-each>
7710
- <xsl:if test="not(*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person'])">
7711
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']/*[local-name() = 'person']">
7712
- <xsl:call-template name="processPersonalAuthor"/>
7713
- </xsl:for-each>
7714
- </xsl:if>
7715
- </xsl:variable>
7716
-
7717
- <xsl:variable name="city" select="*[local-name() = 'place']"/>
7718
- <xsl:variable name="year">
7719
- <xsl:choose>
7720
- <xsl:when test="*[local-name() = 'date'][@type = 'published']">
7721
- <xsl:for-each select="*[local-name() = 'date'][@type = 'published']">
7722
- <xsl:call-template name="renderDate"/>
7723
- </xsl:for-each>
7724
- </xsl:when>
7725
- <xsl:when test="*[local-name() = 'date'][@type = 'issued']">
7726
- <xsl:for-each select="*[local-name() = 'date'][@type = 'issued']">
7727
- <xsl:call-template name="renderDate"/>
7728
- </xsl:for-each>
7729
- </xsl:when>
7730
- <xsl:when test="*[local-name() = 'date'][@type = 'circulated']">
7731
- <xsl:for-each select="*[local-name() = 'date'][@type = 'circulated']">
7732
- <xsl:call-template name="renderDate"/>
7733
- </xsl:for-each>
7734
- </xsl:when>
7735
- <xsl:otherwise>
7736
- <xsl:for-each select="*[local-name() = 'date']">
7737
- <xsl:call-template name="renderDate"/>
7738
- </xsl:for-each>
7739
- </xsl:otherwise>
7740
- </xsl:choose>
7741
- </xsl:variable>
7742
-
7743
- <xsl:variable name="uri" select="*[local-name() = 'uri']"/>
7744
-
7745
-
7746
- <!-- citation structure:
7747
- {personal names | organisation}: {document identifier}, {title}. {publisher}, {city} ({year})
7748
- -->
7749
-
7750
- <!-- Author(s) -->
7751
- <xsl:choose>
7752
- <xsl:when test="xalan:nodeset($personalAuthors)//author">
7753
- <xsl:for-each select="xalan:nodeset($personalAuthors)//author">
7754
- <xsl:apply-templates/>
7755
- <xsl:if test="position() != last()">, </xsl:if>
7756
- </xsl:for-each>
7757
- <xsl:text>: </xsl:text>
7758
- </xsl:when>
7759
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
7760
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
7761
- <xsl:value-of select="."/>
7762
- <xsl:if test="position() != last()">/</xsl:if>
7763
- </xsl:for-each>
7764
- <xsl:text>: </xsl:text>
7765
- </xsl:when>
7766
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
7767
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
7768
- <xsl:value-of select="."/>
7769
- <xsl:if test="position() != last()">, </xsl:if>
7770
- </xsl:for-each>
7771
- <xsl:text>: </xsl:text>
7772
- </xsl:when>
7773
- </xsl:choose>
7774
-
7775
-
7776
- <xsl:variable name="document_identifier">
7777
- <xsl:call-template name="processBibitemDocId"/>
7778
- </xsl:variable>
7779
-
7780
- <xsl:value-of select="$document_identifier"/>
7781
-
7782
- <xsl:apply-templates select="*[local-name() = 'note']"/>
7783
-
7784
- <xsl:variable name="isDraft">
7785
- <xsl:variable name="stage" select="normalize-space(*[local-name() = 'status']/*[local-name() = 'stage'])"/>
7786
- <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>
7787
- </xsl:variable>
7788
-
7789
- <xsl:if test="$isDraft = 'true'">
7790
- <xsl:text> (Draft)</xsl:text>
7791
- </xsl:if>
7792
-
7793
- <xsl:text>, </xsl:text>
7794
-
7795
- <xsl:choose>
7796
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
7797
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
7798
- </xsl:when>
7799
- <xsl:otherwise>
7800
- <xsl:apply-templates select="*[local-name() = 'title']"/>
7801
- </xsl:otherwise>
7802
- </xsl:choose>
7803
-
7804
- <xsl:text>. </xsl:text>
7805
-
7806
- <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
7807
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
7808
- <xsl:value-of select="."/>
7809
- <xsl:if test="position() != last()">, </xsl:if>
7810
- </xsl:for-each>
7811
- <xsl:if test="normalize-space($city) != ''">, </xsl:if>
7812
- </xsl:if>
7813
-
7814
- <xsl:value-of select="$city"/>
7815
-
7816
- <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) != ''">
7817
- <xsl:text> </xsl:text>
7818
- </xsl:if>
7819
-
7820
- <xsl:if test="normalize-space($year) != ''">
7821
- <xsl:text>(</xsl:text>
7822
- <xsl:value-of select="$year"/>
7823
- <xsl:text>). </xsl:text>
7824
- </xsl:if>
7825
-
7826
- <xsl:if test="normalize-space($uri) != ''">
7827
- <fo:inline>
7828
-
7829
- <xsl:text> </xsl:text>
7830
- <fo:basic-link external-destination="{$uri}" fox:alt-text="{$uri}">
7831
- <xsl:value-of select="$uri"/>
7832
- </fo:basic-link>
7833
- </fo:inline>
7834
- </xsl:if>
7835
-
7836
- </xsl:otherwise>
7837
- </xsl:choose>
7769
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
7838
7770
  <!-- end OGC bibitem processing-->
7839
7771
 
7840
7772
  </xsl:template><xsl:template name="processBibitemDocId">
@@ -8162,25 +8094,32 @@
8162
8094
  </fo:block-container>
8163
8095
 
8164
8096
  </xsl:template><xsl:template name="displayAdmonitionName">
8165
-
8097
+ <xsl:param name="sep"/> <!-- Example: ' - ' -->
8098
+ <!-- <xsl:choose>
8099
+ <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
8100
+ <xsl:choose>
8101
+ <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when>
8102
+ <xsl:otherwise>
8103
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8104
+ </xsl:otherwise>
8105
+ </xsl:choose>
8106
+ </xsl:when>
8107
+ <xsl:otherwise>
8166
8108
  <xsl:apply-templates select="*[local-name() = 'name']"/>
8167
8109
  <xsl:if test="not(*[local-name() = 'name'])">
8168
8110
  <xsl:apply-templates select="@type"/>
8169
8111
  </xsl:if>
8170
-
8171
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
8172
- <xsl:apply-templates/>
8173
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
8174
- <xsl:variable name="admonition_type_">
8175
- <xsl:call-template name="getLocalizedString">
8176
- <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
8177
- </xsl:call-template>
8112
+ </xsl:otherwise>
8113
+ </xsl:choose> -->
8114
+ <xsl:variable name="name">
8115
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8178
8116
  </xsl:variable>
8179
- <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
8180
- <xsl:value-of select="$admonition_type"/>
8181
- <xsl:if test="$admonition_type = ''">
8182
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
8117
+ <xsl:copy-of select="$name"/>
8118
+ <xsl:if test="normalize-space($name) != ''">
8119
+ <xsl:value-of select="$sep"/>
8183
8120
  </xsl:if>
8121
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
8122
+ <xsl:apply-templates/>
8184
8123
  </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
8185
8124
 
8186
8125
  <fo:block xsl:use-attribute-sets="admonition-p-style">