Skip to content

Commit 22f89a2

Browse files
xslt update based on metanorma/mn-native-pdf@ec9071e
1 parent d23f2e1 commit 22f89a2

File tree

1 file changed

+53
-30
lines changed

1 file changed

+53
-30
lines changed

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

+53-30
Original file line numberDiff line numberDiff line change
@@ -5182,10 +5182,14 @@
51825182
<xsl:variable name="fn_styles">
51835183
<xsl:choose>
51845184
<xsl:when test="ancestor::*[local-name() = 'bibitem']">
5185-
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
5185+
<fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
5186+
5187+
</fn_styles>
51865188
</xsl:when>
51875189
<xsl:otherwise>
5188-
<fn_styles xsl:use-attribute-sets="fn-num-style"/>
5190+
<fn_styles xsl:use-attribute-sets="fn-num-style">
5191+
5192+
</fn_styles>
51895193
</xsl:otherwise>
51905194
</xsl:choose>
51915195
</xsl:variable>
@@ -8052,6 +8056,7 @@
80528056
<xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
80538057
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
80548058
</xsl:if>
8059+
80558060
<xsl:if test="parent::*[local-name() = 'add']">
80568061
<xsl:call-template name="append_add-style"/>
80578062
</xsl:if>
@@ -8160,44 +8165,44 @@
81608165

81618166
<xsl:template match="*[local-name() = 'note']" name="note">
81628167

8163-
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8168+
<fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
81648169

8165-
<xsl:call-template name="setBlockSpanAll"/>
8170+
<xsl:call-template name="setBlockSpanAll"/>
81668171

8167-
<xsl:call-template name="refine_note-style"/>
8172+
<xsl:call-template name="refine_note-style"/>
81688173

8169-
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8174+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
81708175

8171-
<fo:block>
8176+
<fo:block>
81728177

8173-
<xsl:call-template name="refine_note_block_style"/>
8178+
<xsl:call-template name="refine_note_block_style"/>
81748179

8175-
<fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8180+
<fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
81768181

8177-
<xsl:call-template name="refine_note-name-style"/>
8182+
<xsl:call-template name="refine_note-name-style"/>
81788183

8179-
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8180-
<!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8181-
<xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8182-
<xsl:call-template name="append_add-style"/>
8183-
</xsl:if>
8184+
<!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8185+
<!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8186+
<xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8187+
<xsl:call-template name="append_add-style"/>
8188+
</xsl:if>
81848189

8185-
<!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8186-
<xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8187-
<xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8188-
<xsl:with-param name="skip">false</xsl:with-param>
8189-
</xsl:apply-templates>
8190-
</xsl:if>
8190+
<!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8191+
<xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8192+
<xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8193+
<xsl:with-param name="skip">false</xsl:with-param>
8194+
</xsl:apply-templates>
8195+
</xsl:if>
81918196

8192-
<xsl:apply-templates select="*[local-name() = 'name']"/>
8197+
<xsl:apply-templates select="*[local-name() = 'name']"/>
81938198

8194-
</fo:inline>
8199+
</fo:inline>
81958200

8196-
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8197-
</fo:block>
8201+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8202+
</fo:block>
81988203

8199-
</fo:block-container>
8200-
</fo:block-container>
8204+
</fo:block-container>
8205+
</fo:block-container>
82018206

82028207
</xsl:template>
82038208

@@ -10597,6 +10602,7 @@
1059710602
</xsl:when>
1059810603
<xsl:when test="contains(normalize-space($fo_element), 'block')">
1059910604
<fo:block xsl:use-attribute-sets="example-name-style">
10605+
1060010606
<xsl:apply-templates/>
1060110607
</fo:block>
1060210608
</xsl:when>
@@ -10612,6 +10618,7 @@
1061210618

1061310619
<xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
1061410620
<fo:inline xsl:use-attribute-sets="example-name-style">
10621+
1061510622
<xsl:apply-templates/>
1061610623
</fo:inline>
1061710624
</xsl:template>
@@ -10975,12 +10982,14 @@
1097510982

1097610983
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
1097710984
<fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
10985+
1097810986
<xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
1097910987
</fo:block>
1098010988
</xsl:if>
1098110989

1098210990
<fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
1098310991
<xsl:call-template name="setStyle_preferred"/>
10992+
1098410993
<xsl:apply-templates/>
1098510994
</fo:block>
1098610995
</fo:block>
@@ -14050,9 +14059,10 @@
1405014059
<xsl:template name="insertBackgroundPageImage">
1405114060
<xsl:param name="number">1</xsl:param>
1405214061
<xsl:param name="name">coverpage-image</xsl:param>
14062+
<xsl:param name="suffix"/>
1405314063
<xsl:variable name="num" select="number($number)"/>
1405414064
<!-- background image -->
14055-
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
14065+
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
1405614066
<fo:block>
1405714067
<xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
1405814068
<xsl:choose>
@@ -14118,16 +14128,29 @@
1411814128

1411914129
<!-- END: insert cover page image -->
1412014130

14131+
<xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
1412114132
<xsl:template name="insertVerticalChar">
1412214133
<xsl:param name="str"/>
14134+
<xsl:param name="writing-mode">lr-tb</xsl:param>
14135+
<xsl:param name="reference-orientation">90</xsl:param>
1412314136
<xsl:if test="string-length($str) &gt; 0">
14124-
<fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14137+
<fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14138+
<xsl:if test="normalize-space($writing-mode) != ''">
14139+
<xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
14140+
<xsl:attribute name="reference-orientation">90</xsl:attribute>
14141+
</xsl:if>
14142+
<xsl:variable name="char" select="substring($str,1,1)"/>
14143+
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
14144+
<xsl:attribute name="reference-orientation">0</xsl:attribute>
14145+
</xsl:if>
1412514146
<fo:block-container width="1em">
14126-
<fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
14147+
<fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
1412714148
</fo:block-container>
1412814149
</fo:inline-container>
1412914150
<xsl:call-template name="insertVerticalChar">
1413014151
<xsl:with-param name="str" select="substring($str, 2)"/>
14152+
<xsl:with-param name="writing-mode" select="$writing-mode"/>
14153+
<xsl:with-param name="reference-orientation" select="$reference-orientation"/>
1413114154
</xsl:call-template>
1413214155
</xsl:if>
1413314156
</xsl:template>

0 commit comments

Comments
 (0)