metanorma-ogc 2.4.3 → 2.4.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1138,7 +1138,7 @@
1138
1138
  </fo:list-item-label>
1139
1139
  <fo:list-item-body start-indent="body-start()">
1140
1140
  <fo:block>
1141
- <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:admitted" mode="term_name"/>
1141
+ <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:deprecates | ../ogc:admitted" mode="term_name"/>
1142
1142
  </fo:block>
1143
1143
  </fo:list-item-body>
1144
1144
  </fo:list-item>
@@ -1147,7 +1147,7 @@
1147
1147
  </fo:block>
1148
1148
  </xsl:template>
1149
1149
 
1150
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/>
1150
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" priority="2"/>
1151
1151
 
1152
1152
  <!-- first preferred displays on the same line as term/name -->
1153
1153
  <xsl:template match="ogc:preferred[not(preceding-sibling::ogc:preferred)]" mode="term_name" priority="2">
@@ -1155,9 +1155,9 @@
1155
1155
  <fo:inline padding-right="2mm"> </fo:inline>
1156
1156
  </xsl:template>
1157
1157
 
1158
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" mode="term_name">
1158
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" mode="term_name">
1159
1159
  <xsl:choose>
1160
- <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
1160
+ <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::admitted]">
1161
1161
  <fo:block space-before="6pt"><xsl:call-template name="displayTerm"/></fo:block> <!-- block wrapper -->
1162
1162
  </xsl:when>
1163
1163
  <xsl:otherwise><xsl:call-template name="displayTerm"/></xsl:otherwise>
@@ -1166,24 +1166,48 @@
1166
1166
 
1167
1167
  <xsl:template name="displayTerm">
1168
1168
  <fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline>
1169
- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1169
+ <!-- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1170
1170
  <xsl:variable name="kind" select="local-name()"/>
1171
1171
  <xsl:attribute name="background-color">
1172
1172
  <xsl:choose>
1173
1173
  <xsl:when test="$kind = 'preferred'">rgb(249, 235, 187)</xsl:when>
1174
1174
  <xsl:when test="$kind = 'deprecated'">rgb(237, 237, 238)</xsl:when>
1175
- <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
1175
+ <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
1176
1176
  </xsl:choose>
1177
1177
  </xsl:attribute>
1178
1178
  <xsl:call-template name="addLetterSpacing">
1179
1179
  <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($kind))"/>
1180
- </xsl:call-template>
1181
- </fo:inline>
1182
- <xsl:if test="following-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
1180
+ </xsl:call-template>
1181
+ </fo:inline> -->
1182
+ <xsl:if test="following-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::ogc:admitted]">
1183
1183
  <fo:inline padding-right="2mm"> </fo:inline>
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
+ <xsl:template match="*[local-name() = 'span'][@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" mode="update_xml_step1" priority="2">
1188
+ <xsl:copy>
1189
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
1190
+ </xsl:copy>
1191
+ </xsl:template>
1192
+
1193
+ <xsl:template match="ogc:span[@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" priority="3">
1194
+ <fo:inline> </fo:inline>
1195
+ <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1196
+ <xsl:variable name="kind" select="@class"/>
1197
+ <xsl:variable name="label" select="text()"/>
1198
+ <xsl:attribute name="background-color">
1199
+ <xsl:choose>
1200
+ <xsl:when test="$kind = 'PreferredLabel' or $label = 'PREFERRED'">rgb(249, 235, 187)</xsl:when>
1201
+ <xsl:when test="$kind = 'DeprecatedLabel' or $label = 'DEPRECATED'">rgb(237, 237, 238)</xsl:when>
1202
+ <xsl:when test="$kind = 'AdmittedLabel' or $label = 'ADMITTED'">rgb(223, 236, 249)</xsl:when>
1203
+ </xsl:choose>
1204
+ </xsl:attribute>
1205
+ <xsl:call-template name="addLetterSpacing">
1206
+ <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($label))"/>
1207
+ </xsl:call-template>
1208
+ </fo:inline>
1209
+ </xsl:template>
1210
+
1187
1211
  <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1212
  <xsl:variable name="text">
1189
1213
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -5919,8 +5943,17 @@
5919
5943
  <xsl:variable name="styles_">
5920
5944
  <xsl:for-each select="xalan:nodeset($styles__)/item">
5921
5945
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5922
- <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5923
- <xsl:if test="$key = 'font-family' or $key = 'color'">
5946
+ <xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5947
+ <xsl:variable name="value">
5948
+ <xsl:choose>
5949
+ <!-- if font-size is digits only -->
5950
+ <xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
5951
+ <xsl:otherwise>
5952
+ <xsl:value-of select="$value_"/>
5953
+ </xsl:otherwise>
5954
+ </xsl:choose>
5955
+ </xsl:variable>
5956
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
5924
5957
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5925
5958
  </xsl:if>
5926
5959
  </xsl:for-each>
@@ -1138,7 +1138,7 @@
1138
1138
  </fo:list-item-label>
1139
1139
  <fo:list-item-body start-indent="body-start()">
1140
1140
  <fo:block>
1141
- <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:admitted" mode="term_name"/>
1141
+ <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:deprecates | ../ogc:admitted" mode="term_name"/>
1142
1142
  </fo:block>
1143
1143
  </fo:list-item-body>
1144
1144
  </fo:list-item>
@@ -1147,7 +1147,7 @@
1147
1147
  </fo:block>
1148
1148
  </xsl:template>
1149
1149
 
1150
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/>
1150
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" priority="2"/>
1151
1151
 
1152
1152
  <!-- first preferred displays on the same line as term/name -->
1153
1153
  <xsl:template match="ogc:preferred[not(preceding-sibling::ogc:preferred)]" mode="term_name" priority="2">
@@ -1155,9 +1155,9 @@
1155
1155
  <fo:inline padding-right="2mm"> </fo:inline>
1156
1156
  </xsl:template>
1157
1157
 
1158
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" mode="term_name">
1158
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" mode="term_name">
1159
1159
  <xsl:choose>
1160
- <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
1160
+ <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::admitted]">
1161
1161
  <fo:block space-before="6pt"><xsl:call-template name="displayTerm"/></fo:block> <!-- block wrapper -->
1162
1162
  </xsl:when>
1163
1163
  <xsl:otherwise><xsl:call-template name="displayTerm"/></xsl:otherwise>
@@ -1166,24 +1166,48 @@
1166
1166
 
1167
1167
  <xsl:template name="displayTerm">
1168
1168
  <fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline>
1169
- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1169
+ <!-- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1170
1170
  <xsl:variable name="kind" select="local-name()"/>
1171
1171
  <xsl:attribute name="background-color">
1172
1172
  <xsl:choose>
1173
1173
  <xsl:when test="$kind = 'preferred'">rgb(249, 235, 187)</xsl:when>
1174
1174
  <xsl:when test="$kind = 'deprecated'">rgb(237, 237, 238)</xsl:when>
1175
- <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
1175
+ <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
1176
1176
  </xsl:choose>
1177
1177
  </xsl:attribute>
1178
1178
  <xsl:call-template name="addLetterSpacing">
1179
1179
  <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($kind))"/>
1180
- </xsl:call-template>
1181
- </fo:inline>
1182
- <xsl:if test="following-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
1180
+ </xsl:call-template>
1181
+ </fo:inline> -->
1182
+ <xsl:if test="following-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::ogc:admitted]">
1183
1183
  <fo:inline padding-right="2mm"> </fo:inline>
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
+ <xsl:template match="*[local-name() = 'span'][@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" mode="update_xml_step1" priority="2">
1188
+ <xsl:copy>
1189
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
1190
+ </xsl:copy>
1191
+ </xsl:template>
1192
+
1193
+ <xsl:template match="ogc:span[@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" priority="3">
1194
+ <fo:inline> </fo:inline>
1195
+ <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1196
+ <xsl:variable name="kind" select="@class"/>
1197
+ <xsl:variable name="label" select="text()"/>
1198
+ <xsl:attribute name="background-color">
1199
+ <xsl:choose>
1200
+ <xsl:when test="$kind = 'PreferredLabel' or $label = 'PREFERRED'">rgb(249, 235, 187)</xsl:when>
1201
+ <xsl:when test="$kind = 'DeprecatedLabel' or $label = 'DEPRECATED'">rgb(237, 237, 238)</xsl:when>
1202
+ <xsl:when test="$kind = 'AdmittedLabel' or $label = 'ADMITTED'">rgb(223, 236, 249)</xsl:when>
1203
+ </xsl:choose>
1204
+ </xsl:attribute>
1205
+ <xsl:call-template name="addLetterSpacing">
1206
+ <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($label))"/>
1207
+ </xsl:call-template>
1208
+ </fo:inline>
1209
+ </xsl:template>
1210
+
1187
1211
  <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1212
  <xsl:variable name="text">
1189
1213
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -5919,8 +5943,17 @@
5919
5943
  <xsl:variable name="styles_">
5920
5944
  <xsl:for-each select="xalan:nodeset($styles__)/item">
5921
5945
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5922
- <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5923
- <xsl:if test="$key = 'font-family' or $key = 'color'">
5946
+ <xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5947
+ <xsl:variable name="value">
5948
+ <xsl:choose>
5949
+ <!-- if font-size is digits only -->
5950
+ <xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
5951
+ <xsl:otherwise>
5952
+ <xsl:value-of select="$value_"/>
5953
+ </xsl:otherwise>
5954
+ </xsl:choose>
5955
+ </xsl:variable>
5956
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
5924
5957
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5925
5958
  </xsl:if>
5926
5959
  </xsl:for-each>
@@ -1138,7 +1138,7 @@
1138
1138
  </fo:list-item-label>
1139
1139
  <fo:list-item-body start-indent="body-start()">
1140
1140
  <fo:block>
1141
- <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:admitted" mode="term_name"/>
1141
+ <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:deprecates | ../ogc:admitted" mode="term_name"/>
1142
1142
  </fo:block>
1143
1143
  </fo:list-item-body>
1144
1144
  </fo:list-item>
@@ -1147,7 +1147,7 @@
1147
1147
  </fo:block>
1148
1148
  </xsl:template>
1149
1149
 
1150
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/>
1150
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" priority="2"/>
1151
1151
 
1152
1152
  <!-- first preferred displays on the same line as term/name -->
1153
1153
  <xsl:template match="ogc:preferred[not(preceding-sibling::ogc:preferred)]" mode="term_name" priority="2">
@@ -1155,9 +1155,9 @@
1155
1155
  <fo:inline padding-right="2mm"> </fo:inline>
1156
1156
  </xsl:template>
1157
1157
 
1158
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" mode="term_name">
1158
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" mode="term_name">
1159
1159
  <xsl:choose>
1160
- <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
1160
+ <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::admitted]">
1161
1161
  <fo:block space-before="6pt"><xsl:call-template name="displayTerm"/></fo:block> <!-- block wrapper -->
1162
1162
  </xsl:when>
1163
1163
  <xsl:otherwise><xsl:call-template name="displayTerm"/></xsl:otherwise>
@@ -1166,24 +1166,48 @@
1166
1166
 
1167
1167
  <xsl:template name="displayTerm">
1168
1168
  <fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline>
1169
- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1169
+ <!-- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1170
1170
  <xsl:variable name="kind" select="local-name()"/>
1171
1171
  <xsl:attribute name="background-color">
1172
1172
  <xsl:choose>
1173
1173
  <xsl:when test="$kind = 'preferred'">rgb(249, 235, 187)</xsl:when>
1174
1174
  <xsl:when test="$kind = 'deprecated'">rgb(237, 237, 238)</xsl:when>
1175
- <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
1175
+ <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
1176
1176
  </xsl:choose>
1177
1177
  </xsl:attribute>
1178
1178
  <xsl:call-template name="addLetterSpacing">
1179
1179
  <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($kind))"/>
1180
- </xsl:call-template>
1181
- </fo:inline>
1182
- <xsl:if test="following-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
1180
+ </xsl:call-template>
1181
+ </fo:inline> -->
1182
+ <xsl:if test="following-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::ogc:admitted]">
1183
1183
  <fo:inline padding-right="2mm"> </fo:inline>
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
+ <xsl:template match="*[local-name() = 'span'][@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" mode="update_xml_step1" priority="2">
1188
+ <xsl:copy>
1189
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
1190
+ </xsl:copy>
1191
+ </xsl:template>
1192
+
1193
+ <xsl:template match="ogc:span[@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" priority="3">
1194
+ <fo:inline> </fo:inline>
1195
+ <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1196
+ <xsl:variable name="kind" select="@class"/>
1197
+ <xsl:variable name="label" select="text()"/>
1198
+ <xsl:attribute name="background-color">
1199
+ <xsl:choose>
1200
+ <xsl:when test="$kind = 'PreferredLabel' or $label = 'PREFERRED'">rgb(249, 235, 187)</xsl:when>
1201
+ <xsl:when test="$kind = 'DeprecatedLabel' or $label = 'DEPRECATED'">rgb(237, 237, 238)</xsl:when>
1202
+ <xsl:when test="$kind = 'AdmittedLabel' or $label = 'ADMITTED'">rgb(223, 236, 249)</xsl:when>
1203
+ </xsl:choose>
1204
+ </xsl:attribute>
1205
+ <xsl:call-template name="addLetterSpacing">
1206
+ <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($label))"/>
1207
+ </xsl:call-template>
1208
+ </fo:inline>
1209
+ </xsl:template>
1210
+
1187
1211
  <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1212
  <xsl:variable name="text">
1189
1213
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -5919,8 +5943,17 @@
5919
5943
  <xsl:variable name="styles_">
5920
5944
  <xsl:for-each select="xalan:nodeset($styles__)/item">
5921
5945
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5922
- <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5923
- <xsl:if test="$key = 'font-family' or $key = 'color'">
5946
+ <xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5947
+ <xsl:variable name="value">
5948
+ <xsl:choose>
5949
+ <!-- if font-size is digits only -->
5950
+ <xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
5951
+ <xsl:otherwise>
5952
+ <xsl:value-of select="$value_"/>
5953
+ </xsl:otherwise>
5954
+ </xsl:choose>
5955
+ </xsl:variable>
5956
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
5924
5957
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5925
5958
  </xsl:if>
5926
5959
  </xsl:for-each>
@@ -1138,7 +1138,7 @@
1138
1138
  </fo:list-item-label>
1139
1139
  <fo:list-item-body start-indent="body-start()">
1140
1140
  <fo:block>
1141
- <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:admitted" mode="term_name"/>
1141
+ <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:deprecates | ../ogc:admitted" mode="term_name"/>
1142
1142
  </fo:block>
1143
1143
  </fo:list-item-body>
1144
1144
  </fo:list-item>
@@ -1147,7 +1147,7 @@
1147
1147
  </fo:block>
1148
1148
  </xsl:template>
1149
1149
 
1150
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/>
1150
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" priority="2"/>
1151
1151
 
1152
1152
  <!-- first preferred displays on the same line as term/name -->
1153
1153
  <xsl:template match="ogc:preferred[not(preceding-sibling::ogc:preferred)]" mode="term_name" priority="2">
@@ -1155,9 +1155,9 @@
1155
1155
  <fo:inline padding-right="2mm"> </fo:inline>
1156
1156
  </xsl:template>
1157
1157
 
1158
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" mode="term_name">
1158
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" mode="term_name">
1159
1159
  <xsl:choose>
1160
- <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
1160
+ <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::admitted]">
1161
1161
  <fo:block space-before="6pt"><xsl:call-template name="displayTerm"/></fo:block> <!-- block wrapper -->
1162
1162
  </xsl:when>
1163
1163
  <xsl:otherwise><xsl:call-template name="displayTerm"/></xsl:otherwise>
@@ -1166,24 +1166,48 @@
1166
1166
 
1167
1167
  <xsl:template name="displayTerm">
1168
1168
  <fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline>
1169
- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1169
+ <!-- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1170
1170
  <xsl:variable name="kind" select="local-name()"/>
1171
1171
  <xsl:attribute name="background-color">
1172
1172
  <xsl:choose>
1173
1173
  <xsl:when test="$kind = 'preferred'">rgb(249, 235, 187)</xsl:when>
1174
1174
  <xsl:when test="$kind = 'deprecated'">rgb(237, 237, 238)</xsl:when>
1175
- <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
1175
+ <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
1176
1176
  </xsl:choose>
1177
1177
  </xsl:attribute>
1178
1178
  <xsl:call-template name="addLetterSpacing">
1179
1179
  <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($kind))"/>
1180
- </xsl:call-template>
1181
- </fo:inline>
1182
- <xsl:if test="following-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
1180
+ </xsl:call-template>
1181
+ </fo:inline> -->
1182
+ <xsl:if test="following-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::ogc:admitted]">
1183
1183
  <fo:inline padding-right="2mm"> </fo:inline>
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
+ <xsl:template match="*[local-name() = 'span'][@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" mode="update_xml_step1" priority="2">
1188
+ <xsl:copy>
1189
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
1190
+ </xsl:copy>
1191
+ </xsl:template>
1192
+
1193
+ <xsl:template match="ogc:span[@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" priority="3">
1194
+ <fo:inline> </fo:inline>
1195
+ <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
1196
+ <xsl:variable name="kind" select="@class"/>
1197
+ <xsl:variable name="label" select="text()"/>
1198
+ <xsl:attribute name="background-color">
1199
+ <xsl:choose>
1200
+ <xsl:when test="$kind = 'PreferredLabel' or $label = 'PREFERRED'">rgb(249, 235, 187)</xsl:when>
1201
+ <xsl:when test="$kind = 'DeprecatedLabel' or $label = 'DEPRECATED'">rgb(237, 237, 238)</xsl:when>
1202
+ <xsl:when test="$kind = 'AdmittedLabel' or $label = 'ADMITTED'">rgb(223, 236, 249)</xsl:when>
1203
+ </xsl:choose>
1204
+ </xsl:attribute>
1205
+ <xsl:call-template name="addLetterSpacing">
1206
+ <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($label))"/>
1207
+ </xsl:call-template>
1208
+ </fo:inline>
1209
+ </xsl:template>
1210
+
1187
1211
  <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1212
  <xsl:variable name="text">
1189
1213
  <xsl:call-template name="add-zero-spaces-java"/>
@@ -5919,8 +5943,17 @@
5919
5943
  <xsl:variable name="styles_">
5920
5944
  <xsl:for-each select="xalan:nodeset($styles__)/item">
5921
5945
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5922
- <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5923
- <xsl:if test="$key = 'font-family' or $key = 'color'">
5946
+ <xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5947
+ <xsl:variable name="value">
5948
+ <xsl:choose>
5949
+ <!-- if font-size is digits only -->
5950
+ <xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
5951
+ <xsl:otherwise>
5952
+ <xsl:value-of select="$value_"/>
5953
+ </xsl:otherwise>
5954
+ </xsl:choose>
5955
+ </xsl:variable>
5956
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
5924
5957
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5925
5958
  </xsl:if>
5926
5959
  </xsl:for-each>
@@ -5019,8 +5019,17 @@
5019
5019
  <xsl:variable name="styles_">
5020
5020
  <xsl:for-each select="xalan:nodeset($styles__)/item">
5021
5021
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5022
- <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5023
- <xsl:if test="$key = 'font-family' or $key = 'color'">
5022
+ <xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5023
+ <xsl:variable name="value">
5024
+ <xsl:choose>
5025
+ <!-- if font-size is digits only -->
5026
+ <xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
5027
+ <xsl:otherwise>
5028
+ <xsl:value-of select="$value_"/>
5029
+ </xsl:otherwise>
5030
+ </xsl:choose>
5031
+ </xsl:variable>
5032
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
5024
5033
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5025
5034
  </xsl:if>
5026
5035
  </xsl:for-each>
@@ -914,44 +914,47 @@
914
914
  -->
915
915
  <define name="image">
916
916
  <element name="image">
917
- <attribute name="id">
918
- <data type="ID"/>
917
+ <ref name="Image"/>
918
+ </element>
919
+ </define>
920
+ <define name="Image">
921
+ <attribute name="id">
922
+ <data type="ID"/>
923
+ </attribute>
924
+ <attribute name="src">
925
+ <data type="anyURI"/>
926
+ </attribute>
927
+ <attribute name="mimetype"/>
928
+ <optional>
929
+ <attribute name="filename"/>
930
+ </optional>
931
+ <optional>
932
+ <attribute name="width">
933
+ <choice>
934
+ <data type="int"/>
935
+ <value>auto</value>
936
+ </choice>
919
937
  </attribute>
920
- <attribute name="src">
938
+ </optional>
939
+ <optional>
940
+ <attribute name="height">
941
+ <choice>
942
+ <data type="int"/>
943
+ <value>auto</value>
944
+ </choice>
945
+ </attribute>
946
+ </optional>
947
+ <optional>
948
+ <attribute name="alt"/>
949
+ </optional>
950
+ <optional>
951
+ <attribute name="title"/>
952
+ </optional>
953
+ <optional>
954
+ <attribute name="longdesc">
921
955
  <data type="anyURI"/>
922
956
  </attribute>
923
- <attribute name="mimetype"/>
924
- <optional>
925
- <attribute name="filename"/>
926
- </optional>
927
- <optional>
928
- <attribute name="width">
929
- <choice>
930
- <data type="int"/>
931
- <value>auto</value>
932
- </choice>
933
- </attribute>
934
- </optional>
935
- <optional>
936
- <attribute name="height">
937
- <choice>
938
- <data type="int"/>
939
- <value>auto</value>
940
- </choice>
941
- </attribute>
942
- </optional>
943
- <optional>
944
- <attribute name="alt"/>
945
- </optional>
946
- <optional>
947
- <attribute name="title"/>
948
- </optional>
949
- <optional>
950
- <attribute name="longdesc">
951
- <data type="anyURI"/>
952
- </attribute>
953
- </optional>
954
- </element>
957
+ </optional>
955
958
  </define>
956
959
  <define name="video">
957
960
  <element name="video">
@@ -348,6 +348,9 @@
348
348
  <zeroOrMore>
349
349
  <ref name="contact"/>
350
350
  </zeroOrMore>
351
+ <optional>
352
+ <ref name="logo"/>
353
+ </optional>
351
354
  </element>
352
355
  </define>
353
356
  <define name="orgname">
@@ -366,6 +369,11 @@
366
369
  </choice>
367
370
  </element>
368
371
  </define>
372
+ <define name="logo">
373
+ <element name="logo">
374
+ <ref name="image"/>
375
+ </element>
376
+ </define>
369
377
  <define name="NameWithVariants">
370
378
  <element name="primary">
371
379
  <ref name="LocalizedString"/>
@@ -942,6 +950,7 @@
942
950
  <value>obsoleted</value>
943
951
  <value>confirmed</value>
944
952
  <value>updated</value>
953
+ <value>corrected</value>
945
954
  <value>issued</value>
946
955
  <value>transmitted</value>
947
956
  <value>copied</value>
@@ -86,25 +86,26 @@ module Metanorma
86
86
  end
87
87
 
88
88
  def section_names_terms_cleanup(xml)
89
- replace_title(xml, "//definitions[@type = 'symbols']", @i18n&.symbols)
89
+ @i18n or return
90
+ replace_title(xml, "//definitions[@type = 'symbols']", @i18n.symbols)
90
91
  replace_title(xml, "//definitions[@type = 'abbreviated_terms']",
91
- @i18n&.abbrev)
92
- replace_title(xml, "//definitions[not(@type)]", @i18n&.symbolsabbrev)
92
+ @i18n.abbrev)
93
+ replace_title(xml, "//definitions[not(@type)]", @i18n.symbolsabbrev)
93
94
  replace_title(xml, "//sections//terms#{SYMnoABBR} | " \
94
95
  "//sections//clause[.//terms]#{SYMnoABBR}",
95
- @i18n&.termsdefsymbols, true)
96
+ @i18n.termsdefsymbols, true)
96
97
  replace_title(xml, "//sections//terms#{ABBRnoSYM} | " \
97
98
  "//sections//clause[.//terms]#{ABBRnoSYM}",
98
- @i18n&.termsdefabbrev, true)
99
+ @i18n.termsdefabbrev, true)
99
100
  replace_title(xml, "//sections//terms#{SYMABBR} | " \
100
101
  "//sections//clause[.//terms]#{SYMABBR}",
101
- @i18n&.termsdefsymbolsabbrev, true)
102
+ @i18n.termsdefsymbolsabbrev, true)
102
103
  replace_title(xml, "//sections//terms#{NO_SYMABBR} | " \
103
104
  "//sections//clause[.//terms]#{NO_SYMABBR}",
104
- @i18n&.termsdefsymbolsabbrev, true)
105
+ @i18n.termsdefsymbolsabbrev, true)
105
106
  replace_title(xml, "//sections//terms[not(.//definitions)] | " \
106
107
  "//sections//clause[.//terms][not(.//definitions)]",
107
- @i18n&.termsdef, true)
108
+ @i18n.termsdef, true)
108
109
  end
109
110
 
110
111
  def termdef_cleanup(xmldoc)
@@ -115,8 +116,7 @@ module Metanorma
115
116
  # skip annex/terms/terms, which is empty node
116
117
  def termdef_subclause_cleanup(xmldoc)
117
118
  xmldoc.xpath("//annex//clause[terms]").each do |t|
118
- next unless t.xpath("./clause | ./terms | ./definitions").size == 1
119
-
119
+ t.xpath("./clause | ./terms | ./definitions").size == 1 or next
120
120
  t.children.each { |n| n.parent = t.parent }
121
121
  t.remove
122
122
  end
@@ -224,6 +224,26 @@ module Metanorma
224
224
  partid: partid&.to_i || 0,
225
225
  type: id ? id["type"] : nil }
226
226
  end
227
+
228
+ # Numbers sort *before* letters; we leave out using thorn to force that sort order.
229
+ # case insensitive
230
+ def symbol_key(sym)
231
+ @c.decode(asciimath_key(sym).text)
232
+ .gsub(/[\[\]{}<>()]/, "").gsub(/\s/m, "")
233
+ .gsub(/[[:punct:]]|[_^]/, ":\\0").gsub("`", "")
234
+ end
235
+
236
+ def symbols_cleanup(docxml)
237
+ docxml.xpath("//definitions/dl").each do |dl|
238
+ dl_out = extract_symbols_list(dl)
239
+ dl_out.sort! do |a, b|
240
+ a[:key].downcase <=> b[:key].downcase || a[:key] <=> b[:key] ||
241
+ a[:dt] <=> b[:dt]
242
+ end
243
+ dl.children = dl_out.map { |d| d[:dt].to_s + d[:dd].to_s }.join("\n")
244
+ end
245
+ docxml
246
+ end
227
247
  end
228
248
  end
229
249
  end