Skip to content

Commit 20b6848

Browse files
authored
xslt update based on metanorma/mn-native-pdf@22a38dc
1 parent 22e1df2 commit 20b6848

File tree

1 file changed

+138
-6
lines changed

1 file changed

+138
-6
lines changed

lib/isodoc/plateau/plateau.international-standard.xsl

+138-6
Original file line numberDiff line numberDiff line change
@@ -3072,6 +3072,9 @@
30723072

30733073
</xsl:attribute-set>
30743074

3075+
<xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
3076+
</xsl:attribute-set>
3077+
30753078
<xsl:attribute-set name="definition-style">
30763079

30773080
<xsl:attribute name="space-before">2pt</xsl:attribute>
@@ -11360,14 +11363,17 @@
1136011363
</fo:block>
1136111364
</xsl:template>
1136211365

11363-
<xsl:template match="*[local-name() = 'domain']">
11366+
<!-- <xsl:template match="*[local-name() = 'domain']"> -->
1136411367
<!-- https://github.com/metanorma/isodoc/issues/607
1136511368
<fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
1136611369
<xsl:text> </xsl:text> -->
11367-
<xsl:if test="not(@hidden = 'true')">
11370+
<!-- <xsl:if test="not(@hidden = 'true')">
1136811371
<xsl:apply-templates/>
1136911372
</xsl:if>
11370-
</xsl:template>
11373+
</xsl:template> -->
11374+
11375+
<!-- https://github.com/metanorma/isodoc/issues/632#issuecomment-2567163931 -->
11376+
<xsl:template match="*[local-name() = 'domain']"/>
1137111377

1137211378
<xsl:template match="*[local-name() = 'admitted']">
1137311379
<fo:block xsl:use-attribute-sets="admitted-style">
@@ -11382,9 +11388,11 @@
1138211388
</xsl:template>
1138311389

1138411390
<xsl:template name="setStyle_preferred">
11385-
<xsl:if test="*[local-name() = 'strong']">
11386-
<xsl:attribute name="font-weight">normal</xsl:attribute>
11387-
</xsl:if>
11391+
11392+
<xsl:if test="*[local-name() = 'strong']">
11393+
<xsl:attribute name="font-weight">normal</xsl:attribute>
11394+
</xsl:if>
11395+
1138811396
</xsl:template>
1138911397

1139011398
<!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
@@ -11394,6 +11402,17 @@
1139411402
</xsl:template>
1139511403
<!-- End Preferred, admitted, deprecated -->
1139611404

11405+
<xsl:template match="*[local-name() = 'fmt-related']">
11406+
<fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
11407+
<xsl:apply-templates/>
11408+
</fo:block>
11409+
</xsl:template>
11410+
<xsl:template match="*[local-name() = 'fmt-related']/*[local-name() = 'p']" priority="4">
11411+
<fo:block>
11412+
<xsl:apply-templates/>
11413+
</fo:block>
11414+
</xsl:template>
11415+
1139711416
<!-- ========== -->
1139811417
<!-- definition -->
1139911418
<!-- ========== -->
@@ -13088,6 +13107,31 @@
1308813107
<xsl:template match="*[local-name() = 'name'][following-sibling::*[1][local-name() = 'fmt-name']]" mode="update_xml_pres"/>
1308913108
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
1309013109
<xsl:template match="*[local-name() = 'section-title'][following-sibling::*[1][local-name() = 'p'][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_pres"/>
13110+
<!-- <xsl:template match="*[local-name() = 'preferred'][following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
13111+
<xsl:template match="*[local-name() = 'preferred']" mode="update_xml_step1"/>
13112+
<!-- <xsl:template match="*[local-name() = 'preferred'][following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_pres"/> -->
13113+
<xsl:template match="*[local-name() = 'preferred']" mode="update_xml_pres"/>
13114+
<!-- <xsl:template match="*[local-name() = 'admitted'][following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
13115+
<xsl:template match="*[local-name() = 'admitted']" mode="update_xml_step1"/>
13116+
<!-- <xsl:template match="*[local-name() = 'admitted'][following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_pres"/> -->
13117+
<xsl:template match="*[local-name() = 'admitted']" mode="update_xml_pres"/>
13118+
<!-- <xsl:template match="*[local-name() = 'deprecates'][following-sibling::*[not(local-name() = 'deprecates')][1][local-name() = 'fmt-deprecates']]" mode="update_xml_step1"/> -->
13119+
<xsl:template match="*[local-name() = 'deprecates']" mode="update_xml_step1"/>
13120+
<xsl:template match="*[local-name() = 'related']" mode="update_xml_step1"/>
13121+
<!-- <xsl:template match="*[local-name() = 'deprecates'][following-sibling::*[not(local-name() = 'deprecates')][1][local-name() = 'fmt-deprecates']]" mode="update_xml_pres"/> -->
13122+
<xsl:template match="*[local-name() = 'deprecates']" mode="update_xml_pres"/>
13123+
<xsl:template match="*[local-name() = 'related']" mode="update_xml_pres"/>
13124+
<!-- <xsl:template match="*[local-name() = 'definition'][following-sibling::*[1][local-name() = 'fmt-definition']]" mode="update_xml_step1"/> -->
13125+
<xsl:template match="*[local-name() = 'definition']" mode="update_xml_step1"/>
13126+
<!-- <xsl:template match="*[local-name() = 'definition'][following-sibling::*[1][local-name() = 'fmt-definition']]" mode="update_xml_pres"/> -->
13127+
<xsl:template match="*[local-name() = 'definition']" mode="update_xml_pres"/>
13128+
<!-- <xsl:template match="*[local-name() = 'termsource'][following-sibling::*[1][local-name() = 'fmt-termsource']]" mode="update_xml_step1"/> -->
13129+
<xsl:template match="*[local-name() = 'termsource']" mode="update_xml_step1"/>
13130+
<!-- <xsl:template match="*[local-name() = 'termsource'][following-sibling::*[1][local-name() = 'fmt-termsource']]" mode="update_xml_pres"/> -->
13131+
<xsl:template match="*[local-name() = 'termsource']" mode="update_xml_pres"/>
13132+
13133+
<xsl:template match="*[local-name() = 'term'][@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
13134+
<xsl:template match="*[local-name() = 'term'][@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_pres"/>
1309113135

1309213136
<xsl:template match="*[local-name() = 'p'][@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][local-name() = 'section-title']]" mode="update_xml_step1">
1309313137
<xsl:copy>
@@ -13132,6 +13176,94 @@
1313213176
</xsl:element>
1313313177
</xsl:template>
1313413178

13179+
<xsl:template match="*[local-name() = 'fmt-preferred']"/>
13180+
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
13181+
<xsl:apply-templates mode="update_xml_step1"/>
13182+
</xsl:template>
13183+
<xsl:template match="*[local-name() = 'fmt-preferred'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-preferred']/*[local-name() = 'p']" mode="update_xml_step1">
13184+
<xsl:element name="preferred" namespace="{$namespace_full}">
13185+
<xsl:copy-of select="@*"/>
13186+
<xsl:apply-templates mode="update_xml_step1"/>
13187+
</xsl:element>
13188+
</xsl:template>
13189+
<xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_pres">
13190+
<xsl:apply-templates mode="update_xml_pres"/>
13191+
</xsl:template>
13192+
<xsl:template match="*[local-name() = 'fmt-preferred'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-preferred']/*[local-name() = 'p']" mode="update_xml_pres">
13193+
<xsl:element name="preferred" namespace="{$namespace_full}">
13194+
<xsl:copy-of select="@*"/>
13195+
<xsl:apply-templates mode="update_xml_pres"/>
13196+
</xsl:element>
13197+
</xsl:template>
13198+
13199+
<xsl:template match="*[local-name() = 'fmt-admitted']"/>
13200+
<xsl:template match="*[local-name() = 'fmt-admitted'][*[local-name() = 'p']]" mode="update_xml_step1">
13201+
<xsl:apply-templates mode="update_xml_step1"/>
13202+
</xsl:template>
13203+
<xsl:template match="*[local-name() = 'fmt-admitted'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-admitted']/*[local-name() = 'p']" mode="update_xml_step1">
13204+
<xsl:element name="admitted" namespace="{$namespace_full}">
13205+
<xsl:copy-of select="@*"/>
13206+
<xsl:apply-templates mode="update_xml_step1"/>
13207+
</xsl:element>
13208+
</xsl:template>
13209+
<xsl:template match="*[local-name() = 'fmt-admitted'][*[local-name() = 'p']]" mode="update_xml_pres">
13210+
<xsl:apply-templates mode="update_xml_pres"/>
13211+
</xsl:template>
13212+
<xsl:template match="*[local-name() = 'fmt-admitted'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-admitted']/*[local-name() = 'p']" mode="update_xml_pres">
13213+
<xsl:element name="admitted" namespace="{$namespace_full}">
13214+
<xsl:copy-of select="@*"/>
13215+
<xsl:apply-templates mode="update_xml_pres"/>
13216+
</xsl:element>
13217+
</xsl:template>
13218+
13219+
<xsl:template match="*[local-name() = 'fmt-deprecates']"/>
13220+
<xsl:template match="*[local-name() = 'fmt-deprecates'][*[local-name() = 'p']]" mode="update_xml_step1">
13221+
<xsl:apply-templates mode="update_xml_step1"/>
13222+
</xsl:template>
13223+
<xsl:template match="*[local-name() = 'fmt-deprecates'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-deprecates']/*[local-name() = 'p']" mode="update_xml_step1">
13224+
<xsl:element name="deprecates" namespace="{$namespace_full}">
13225+
<xsl:copy-of select="@*"/>
13226+
<xsl:apply-templates mode="update_xml_step1"/>
13227+
</xsl:element>
13228+
</xsl:template>
13229+
<xsl:template match="*[local-name() = 'fmt-deprecates'][*[local-name() = 'p']]" mode="update_xml_pres">
13230+
<xsl:apply-templates mode="update_xml_pres"/>
13231+
</xsl:template>
13232+
<xsl:template match="*[local-name() = 'fmt-deprecates'][not(*[local-name() = 'p'])] | *[local-name() = 'fmt-deprecates']/*[local-name() = 'p']" mode="update_xml_pres">
13233+
<xsl:element name="deprecates" namespace="{$namespace_full}">
13234+
<xsl:copy-of select="@*"/>
13235+
<xsl:apply-templates mode="update_xml_pres"/>
13236+
</xsl:element>
13237+
</xsl:template>
13238+
13239+
<xsl:template match="*[local-name() = 'fmt-definition']"/>
13240+
<xsl:template match="*[local-name() = 'fmt-definition']" mode="update_xml_step1">
13241+
<xsl:element name="definition" namespace="{$namespace_full}">
13242+
<xsl:copy-of select="@*"/>
13243+
<xsl:apply-templates mode="update_xml_step1"/>
13244+
</xsl:element>
13245+
</xsl:template>
13246+
<xsl:template match="*[local-name() = 'fmt-definition']" mode="update_xml_pres">
13247+
<xsl:element name="definition" namespace="{$namespace_full}">
13248+
<xsl:copy-of select="@*"/>
13249+
<xsl:apply-templates mode="update_xml_pres"/>
13250+
</xsl:element>
13251+
</xsl:template>
13252+
13253+
<xsl:template match="*[local-name() = 'fmt-termsource']"/>
13254+
<xsl:template match="*[local-name() = 'fmt-termsource']" mode="update_xml_step1">
13255+
<xsl:element name="termsource" namespace="{$namespace_full}">
13256+
<xsl:copy-of select="@*"/>
13257+
<xsl:apply-templates mode="update_xml_step1"/>
13258+
</xsl:element>
13259+
</xsl:template>
13260+
<xsl:template match="*[local-name() = 'fmt-termsource']" mode="update_xml_pres">
13261+
<xsl:element name="termsource" namespace="{$namespace_full}">
13262+
<xsl:copy-of select="@*"/>
13263+
<xsl:apply-templates mode="update_xml_pres"/>
13264+
</xsl:element>
13265+
</xsl:template>
13266+
1313513267
<xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
1313613268
<xsl:apply-templates mode="update_xml_step1"/>
1313713269
</xsl:template>

0 commit comments

Comments
 (0)