metanorma-ogc 2.0.7 → 2.0.8

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.
@@ -130,7 +130,13 @@
130
130
 
131
131
  <xsl:template match="/">
132
132
  <xsl:call-template name="namespaceCheck"/>
133
- <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
133
+ <fo:root xml:lang="{$lang}">
134
+ <xsl:variable name="root-style">
135
+ <root-style xsl:use-attribute-sets="root-style"/>
136
+ </xsl:variable>
137
+ <xsl:call-template name="insertRootStyle">
138
+ <xsl:with-param name="root-style" select="$root-style"/>
139
+ </xsl:call-template>
134
140
  <fo:layout-master-set>
135
141
  <!-- Cover page -->
136
142
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
@@ -1604,7 +1610,30 @@
1604
1610
 
1605
1611
 
1606
1612
 
1607
- </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
1613
+ </xsl:attribute-set><xsl:template name="insertRootStyle">
1614
+ <xsl:param name="root-style"/>
1615
+ <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
1616
+
1617
+ <xsl:variable name="additional_fonts_">
1618
+ <xsl:for-each select="//*[local-name() = 'misc-container'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
1619
+ <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
1620
+ </xsl:for-each>
1621
+ </xsl:variable>
1622
+ <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
1623
+
1624
+ <xsl:for-each select="$root-style_/root-style/@*">
1625
+ <xsl:choose>
1626
+ <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
1627
+ <xsl:attribute name="{local-name()}">
1628
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
1629
+ </xsl:attribute>
1630
+ </xsl:when>
1631
+ <xsl:otherwise>
1632
+ <xsl:copy-of select="."/>
1633
+ </xsl:otherwise>
1634
+ </xsl:choose>
1635
+ </xsl:for-each>
1636
+ </xsl:template><xsl:attribute-set name="copyright-statement-style">
1608
1637
 
1609
1638
  <xsl:attribute name="font-size">8pt</xsl:attribute>
1610
1639
  <xsl:attribute name="line-height">125%</xsl:attribute>
@@ -2195,7 +2224,7 @@
2195
2224
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2196
2225
 
2197
2226
 
2198
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2227
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2199
2228
 
2200
2229
 
2201
2230
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4634,24 +4663,28 @@
4634
4663
  </xsl:template><xsl:template name="add-zero-spaces-equal">
4635
4664
  <xsl:param name="text" select="."/>
4636
4665
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
4666
+ <xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
4637
4667
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
4668
+ <xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
4638
4669
  <xsl:variable name="zero-space">​</xsl:variable>
4639
4670
  <xsl:choose>
4640
4671
  <xsl:when test="contains($text, $zero-space-after-equals)">
4641
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
4672
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
4642
4673
  <xsl:value-of select="$zero-space-after-equals"/>
4643
4674
  <xsl:value-of select="$zero-space"/>
4644
4675
  <xsl:call-template name="add-zero-spaces-equal">
4645
4676
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
4646
- </xsl:call-template>
4677
+ </xsl:call-template> -->
4678
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
4647
4679
  </xsl:when>
4648
4680
  <xsl:when test="contains($text, $zero-space-after-equal)">
4649
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
4681
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
4650
4682
  <xsl:value-of select="$zero-space-after-equal"/>
4651
4683
  <xsl:value-of select="$zero-space"/>
4652
4684
  <xsl:call-template name="add-zero-spaces-equal">
4653
4685
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
4654
- </xsl:call-template>
4686
+ </xsl:call-template> -->
4687
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
4655
4688
  </xsl:when>
4656
4689
  <xsl:otherwise>
4657
4690
  <xsl:value-of select="$text"/>
@@ -5131,7 +5164,12 @@
5131
5164
 
5132
5165
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5133
5166
 
5167
+ <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
5168
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
5169
+ </xsl:if>
5170
+
5134
5171
 
5172
+
5135
5173
 
5136
5174
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
5137
5175
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
@@ -6140,17 +6178,15 @@
6140
6178
 
6141
6179
  <!-- split text by zero-width space -->
6142
6180
  <xsl:variable name="text_step4">
6143
- <xsl:call-template name="split">
6181
+ <xsl:call-template name="split_for_interspers">
6144
6182
  <xsl:with-param name="pText" select="$text_step3"/>
6145
6183
  <xsl:with-param name="sep" select="$zero_width_space"/>
6146
- <xsl:with-param name="normalize-space">false</xsl:with-param>
6147
- <xsl:with-param name="keep_sep">true</xsl:with-param>
6148
6184
  </xsl:call-template>
6149
6185
  </xsl:variable>
6150
6186
 
6151
- <xsl:for-each select="xalan:nodeset($text_step4)/item">
6187
+ <xsl:for-each select="xalan:nodeset($text_step4)/node()">
6152
6188
  <xsl:choose>
6153
- <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6189
+ <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6154
6190
  <xsl:call-template name="interspers">
6155
6191
  <xsl:with-param name="str" select="."/>
6156
6192
  </xsl:call-template>
@@ -6161,6 +6197,30 @@
6161
6197
  </xsl:choose>
6162
6198
  </xsl:for-each>
6163
6199
 
6200
+ </xsl:template><xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable><xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable><xsl:template name="split_for_interspers">
6201
+ <xsl:param name="pText" select="."/>
6202
+ <xsl:param name="sep" select="','"/>
6203
+ <!-- word with length more than 30 will be interspersed with zero-width space -->
6204
+ <xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
6205
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
6206
+ <xsl:call-template name="replace_tag_interspers">
6207
+ <xsl:with-param name="text" select="$text"/>
6208
+ </xsl:call-template>
6209
+ </xsl:template><xsl:template name="replace_tag_interspers">
6210
+ <xsl:param name="text"/>
6211
+ <xsl:choose>
6212
+ <xsl:when test="contains($text, $interspers_tag_open)">
6213
+ <xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
6214
+ <xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
6215
+ <interspers>
6216
+ <xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
6217
+ </interspers>
6218
+ <xsl:call-template name="replace_tag_interspers">
6219
+ <xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
6220
+ </xsl:call-template>
6221
+ </xsl:when>
6222
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
6223
+ </xsl:choose>
6164
6224
  </xsl:template><xsl:template name="interspers">
6165
6225
  <xsl:param name="str"/>
6166
6226
  <xsl:param name="char" select="$zero_width_space"/>
@@ -6618,7 +6678,7 @@
6618
6678
  </xsl:otherwise>
6619
6679
  </xsl:choose> -->
6620
6680
  </fo:block>
6621
- </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
6681
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
6622
6682
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
6623
6683
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
6624
6684
  <xsl:if test="normalize-space() != ''">
@@ -130,7 +130,13 @@
130
130
 
131
131
  <xsl:template match="/">
132
132
  <xsl:call-template name="namespaceCheck"/>
133
- <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
133
+ <fo:root xml:lang="{$lang}">
134
+ <xsl:variable name="root-style">
135
+ <root-style xsl:use-attribute-sets="root-style"/>
136
+ </xsl:variable>
137
+ <xsl:call-template name="insertRootStyle">
138
+ <xsl:with-param name="root-style" select="$root-style"/>
139
+ </xsl:call-template>
134
140
  <fo:layout-master-set>
135
141
  <!-- Cover page -->
136
142
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
@@ -1604,7 +1610,30 @@
1604
1610
 
1605
1611
 
1606
1612
 
1607
- </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
1613
+ </xsl:attribute-set><xsl:template name="insertRootStyle">
1614
+ <xsl:param name="root-style"/>
1615
+ <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
1616
+
1617
+ <xsl:variable name="additional_fonts_">
1618
+ <xsl:for-each select="//*[local-name() = 'misc-container'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
1619
+ <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
1620
+ </xsl:for-each>
1621
+ </xsl:variable>
1622
+ <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
1623
+
1624
+ <xsl:for-each select="$root-style_/root-style/@*">
1625
+ <xsl:choose>
1626
+ <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
1627
+ <xsl:attribute name="{local-name()}">
1628
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
1629
+ </xsl:attribute>
1630
+ </xsl:when>
1631
+ <xsl:otherwise>
1632
+ <xsl:copy-of select="."/>
1633
+ </xsl:otherwise>
1634
+ </xsl:choose>
1635
+ </xsl:for-each>
1636
+ </xsl:template><xsl:attribute-set name="copyright-statement-style">
1608
1637
 
1609
1638
  <xsl:attribute name="font-size">8pt</xsl:attribute>
1610
1639
  <xsl:attribute name="line-height">125%</xsl:attribute>
@@ -2195,7 +2224,7 @@
2195
2224
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2196
2225
 
2197
2226
 
2198
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2227
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2199
2228
 
2200
2229
 
2201
2230
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4634,24 +4663,28 @@
4634
4663
  </xsl:template><xsl:template name="add-zero-spaces-equal">
4635
4664
  <xsl:param name="text" select="."/>
4636
4665
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
4666
+ <xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
4637
4667
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
4668
+ <xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
4638
4669
  <xsl:variable name="zero-space">​</xsl:variable>
4639
4670
  <xsl:choose>
4640
4671
  <xsl:when test="contains($text, $zero-space-after-equals)">
4641
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
4672
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
4642
4673
  <xsl:value-of select="$zero-space-after-equals"/>
4643
4674
  <xsl:value-of select="$zero-space"/>
4644
4675
  <xsl:call-template name="add-zero-spaces-equal">
4645
4676
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
4646
- </xsl:call-template>
4677
+ </xsl:call-template> -->
4678
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
4647
4679
  </xsl:when>
4648
4680
  <xsl:when test="contains($text, $zero-space-after-equal)">
4649
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
4681
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
4650
4682
  <xsl:value-of select="$zero-space-after-equal"/>
4651
4683
  <xsl:value-of select="$zero-space"/>
4652
4684
  <xsl:call-template name="add-zero-spaces-equal">
4653
4685
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
4654
- </xsl:call-template>
4686
+ </xsl:call-template> -->
4687
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
4655
4688
  </xsl:when>
4656
4689
  <xsl:otherwise>
4657
4690
  <xsl:value-of select="$text"/>
@@ -5131,7 +5164,12 @@
5131
5164
 
5132
5165
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5133
5166
 
5167
+ <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
5168
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
5169
+ </xsl:if>
5170
+
5134
5171
 
5172
+
5135
5173
 
5136
5174
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
5137
5175
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
@@ -6140,17 +6178,15 @@
6140
6178
 
6141
6179
  <!-- split text by zero-width space -->
6142
6180
  <xsl:variable name="text_step4">
6143
- <xsl:call-template name="split">
6181
+ <xsl:call-template name="split_for_interspers">
6144
6182
  <xsl:with-param name="pText" select="$text_step3"/>
6145
6183
  <xsl:with-param name="sep" select="$zero_width_space"/>
6146
- <xsl:with-param name="normalize-space">false</xsl:with-param>
6147
- <xsl:with-param name="keep_sep">true</xsl:with-param>
6148
6184
  </xsl:call-template>
6149
6185
  </xsl:variable>
6150
6186
 
6151
- <xsl:for-each select="xalan:nodeset($text_step4)/item">
6187
+ <xsl:for-each select="xalan:nodeset($text_step4)/node()">
6152
6188
  <xsl:choose>
6153
- <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6189
+ <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6154
6190
  <xsl:call-template name="interspers">
6155
6191
  <xsl:with-param name="str" select="."/>
6156
6192
  </xsl:call-template>
@@ -6161,6 +6197,30 @@
6161
6197
  </xsl:choose>
6162
6198
  </xsl:for-each>
6163
6199
 
6200
+ </xsl:template><xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable><xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable><xsl:template name="split_for_interspers">
6201
+ <xsl:param name="pText" select="."/>
6202
+ <xsl:param name="sep" select="','"/>
6203
+ <!-- word with length more than 30 will be interspersed with zero-width space -->
6204
+ <xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
6205
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
6206
+ <xsl:call-template name="replace_tag_interspers">
6207
+ <xsl:with-param name="text" select="$text"/>
6208
+ </xsl:call-template>
6209
+ </xsl:template><xsl:template name="replace_tag_interspers">
6210
+ <xsl:param name="text"/>
6211
+ <xsl:choose>
6212
+ <xsl:when test="contains($text, $interspers_tag_open)">
6213
+ <xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
6214
+ <xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
6215
+ <interspers>
6216
+ <xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
6217
+ </interspers>
6218
+ <xsl:call-template name="replace_tag_interspers">
6219
+ <xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
6220
+ </xsl:call-template>
6221
+ </xsl:when>
6222
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
6223
+ </xsl:choose>
6164
6224
  </xsl:template><xsl:template name="interspers">
6165
6225
  <xsl:param name="str"/>
6166
6226
  <xsl:param name="char" select="$zero_width_space"/>
@@ -6618,7 +6678,7 @@
6618
6678
  </xsl:otherwise>
6619
6679
  </xsl:choose> -->
6620
6680
  </fo:block>
6621
- </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
6681
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
6622
6682
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
6623
6683
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
6624
6684
  <xsl:if test="normalize-space() != ''">
@@ -87,7 +87,13 @@
87
87
 
88
88
  <xsl:template match="/">
89
89
  <xsl:call-template name="namespaceCheck"/>
90
- <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
90
+ <fo:root xml:lang="{$lang}">
91
+ <xsl:variable name="root-style">
92
+ <root-style xsl:use-attribute-sets="root-style"/>
93
+ </xsl:variable>
94
+ <xsl:call-template name="insertRootStyle">
95
+ <xsl:with-param name="root-style" select="$root-style"/>
96
+ </xsl:call-template>
91
97
  <fo:layout-master-set>
92
98
 
93
99
  <!-- Document pages -->
@@ -784,7 +790,30 @@
784
790
 
785
791
 
786
792
 
787
- </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
793
+ </xsl:attribute-set><xsl:template name="insertRootStyle">
794
+ <xsl:param name="root-style"/>
795
+ <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
796
+
797
+ <xsl:variable name="additional_fonts_">
798
+ <xsl:for-each select="//*[local-name() = 'misc-container'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
799
+ <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
800
+ </xsl:for-each>
801
+ </xsl:variable>
802
+ <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
803
+
804
+ <xsl:for-each select="$root-style_/root-style/@*">
805
+ <xsl:choose>
806
+ <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
807
+ <xsl:attribute name="{local-name()}">
808
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
809
+ </xsl:attribute>
810
+ </xsl:when>
811
+ <xsl:otherwise>
812
+ <xsl:copy-of select="."/>
813
+ </xsl:otherwise>
814
+ </xsl:choose>
815
+ </xsl:for-each>
816
+ </xsl:template><xsl:attribute-set name="copyright-statement-style">
788
817
 
789
818
  </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
790
819
 
@@ -1384,7 +1413,7 @@
1384
1413
 
1385
1414
 
1386
1415
 
1387
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1416
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1388
1417
 
1389
1418
 
1390
1419
 
@@ -3835,24 +3864,28 @@
3835
3864
  </xsl:template><xsl:template name="add-zero-spaces-equal">
3836
3865
  <xsl:param name="text" select="."/>
3837
3866
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
3867
+ <xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
3838
3868
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
3869
+ <xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
3839
3870
  <xsl:variable name="zero-space">​</xsl:variable>
3840
3871
  <xsl:choose>
3841
3872
  <xsl:when test="contains($text, $zero-space-after-equals)">
3842
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
3873
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
3843
3874
  <xsl:value-of select="$zero-space-after-equals"/>
3844
3875
  <xsl:value-of select="$zero-space"/>
3845
3876
  <xsl:call-template name="add-zero-spaces-equal">
3846
3877
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
3847
- </xsl:call-template>
3878
+ </xsl:call-template> -->
3879
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
3848
3880
  </xsl:when>
3849
3881
  <xsl:when test="contains($text, $zero-space-after-equal)">
3850
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
3882
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
3851
3883
  <xsl:value-of select="$zero-space-after-equal"/>
3852
3884
  <xsl:value-of select="$zero-space"/>
3853
3885
  <xsl:call-template name="add-zero-spaces-equal">
3854
3886
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
3855
- </xsl:call-template>
3887
+ </xsl:call-template> -->
3888
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
3856
3889
  </xsl:when>
3857
3890
  <xsl:otherwise>
3858
3891
  <xsl:value-of select="$text"/>
@@ -4332,7 +4365,12 @@
4332
4365
 
4333
4366
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
4334
4367
 
4368
+ <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
4369
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
4370
+ </xsl:if>
4371
+
4335
4372
 
4373
+
4336
4374
 
4337
4375
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
4338
4376
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
@@ -5301,17 +5339,15 @@
5301
5339
 
5302
5340
  <!-- split text by zero-width space -->
5303
5341
  <xsl:variable name="text_step4">
5304
- <xsl:call-template name="split">
5342
+ <xsl:call-template name="split_for_interspers">
5305
5343
  <xsl:with-param name="pText" select="$text_step3"/>
5306
5344
  <xsl:with-param name="sep" select="$zero_width_space"/>
5307
- <xsl:with-param name="normalize-space">false</xsl:with-param>
5308
- <xsl:with-param name="keep_sep">true</xsl:with-param>
5309
5345
  </xsl:call-template>
5310
5346
  </xsl:variable>
5311
5347
 
5312
- <xsl:for-each select="xalan:nodeset($text_step4)/item">
5348
+ <xsl:for-each select="xalan:nodeset($text_step4)/node()">
5313
5349
  <xsl:choose>
5314
- <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5350
+ <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5315
5351
  <xsl:call-template name="interspers">
5316
5352
  <xsl:with-param name="str" select="."/>
5317
5353
  </xsl:call-template>
@@ -5322,6 +5358,30 @@
5322
5358
  </xsl:choose>
5323
5359
  </xsl:for-each>
5324
5360
 
5361
+ </xsl:template><xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable><xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable><xsl:template name="split_for_interspers">
5362
+ <xsl:param name="pText" select="."/>
5363
+ <xsl:param name="sep" select="','"/>
5364
+ <!-- word with length more than 30 will be interspersed with zero-width space -->
5365
+ <xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
5366
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
5367
+ <xsl:call-template name="replace_tag_interspers">
5368
+ <xsl:with-param name="text" select="$text"/>
5369
+ </xsl:call-template>
5370
+ </xsl:template><xsl:template name="replace_tag_interspers">
5371
+ <xsl:param name="text"/>
5372
+ <xsl:choose>
5373
+ <xsl:when test="contains($text, $interspers_tag_open)">
5374
+ <xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
5375
+ <xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
5376
+ <interspers>
5377
+ <xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
5378
+ </interspers>
5379
+ <xsl:call-template name="replace_tag_interspers">
5380
+ <xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
5381
+ </xsl:call-template>
5382
+ </xsl:when>
5383
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
5384
+ </xsl:choose>
5325
5385
  </xsl:template><xsl:template name="interspers">
5326
5386
  <xsl:param name="str"/>
5327
5387
  <xsl:param name="char" select="$zero_width_space"/>
@@ -5779,7 +5839,7 @@
5779
5839
  </xsl:otherwise>
5780
5840
  </xsl:choose> -->
5781
5841
  </fo:block>
5782
- </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
5842
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
5783
5843
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
5784
5844
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
5785
5845
  <xsl:if test="normalize-space() != ''">
@@ -226,7 +226,8 @@ module IsoDoc
226
226
 
227
227
  def bibliography_bibitem_number_skip(bibitem)
228
228
  @xrefs.klass.implicit_reference(bibitem) ||
229
- bibitem.at(ns(".//docidentifier[@type = 'metanorma-ordinal']"))
229
+ bibitem.at(ns(".//docidentifier[@type = 'metanorma-ordinal']")) ||
230
+ bibitem["hidden"] == "true" || bibitem.parent["hidden"] == "true"
230
231
  end
231
232
 
232
233
  include Init
@@ -527,7 +527,7 @@
527
527
  </define>
528
528
  <define name="LocalityType">
529
529
  <data type="string">
530
- <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
530
+ <param name="pattern">section|clause|part|paragraph|chapter|page|title|line|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
531
531
  </data>
532
532
  </define>
533
533
  <define name="referenceFrom">
@@ -677,6 +677,9 @@
677
677
  <zeroOrMore>
678
678
  <ref name="extent"/>
679
679
  </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
680
683
  <zeroOrMore>
681
684
  <ref name="accesslocation"/>
682
685
  </zeroOrMore>
@@ -922,9 +925,29 @@
922
925
  <text/>
923
926
  </element>
924
927
  </define>
928
+ <define name="sizevalue">
929
+ <element name="value">
930
+ <attribute name="type"/>
931
+ <text/>
932
+ </element>
933
+ </define>
934
+ <define name="bibliographic_size">
935
+ <element name="size">
936
+ <oneOrMore>
937
+ <ref name="sizevalue"/>
938
+ </oneOrMore>
939
+ </element>
940
+ </define>
925
941
  <define name="extent">
926
942
  <element name="extent">
927
- <ref name="BibItemLocality"/>
943
+ <choice>
944
+ <zeroOrMore>
945
+ <ref name="locality"/>
946
+ </zeroOrMore>
947
+ <zeroOrMore>
948
+ <ref name="localityStack"/>
949
+ </zeroOrMore>
950
+ </choice>
928
951
  </element>
929
952
  </define>
930
953
  <define name="series">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.0.7".freeze
3
+ VERSION = "2.0.8".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-04 00:00:00.000000000 Z
11
+ date: 2022-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639