Skip to content

Commit e377bd4

Browse files
xslt update based on metanorma/mn-native-pdf@8dc1b69
1 parent 343ba90 commit e377bd4

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

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

+47
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@
873873
<xsl:template match="*[local-name() = 'preface']/*[local-name() = 'page_sequence']/*[local-name() = 'clause']" priority="3">
874874
<fo:block>
875875
<xsl:call-template name="setId"/>
876+
<xsl:call-template name="addReviewHelper"/>
876877
<xsl:apply-templates/>
877878
</fo:block>
878879
</xsl:template>
@@ -11054,6 +11055,29 @@
1105411055
<!-- END definition -->
1105511056
<!-- ========== -->
1105611057

11058+
<xsl:variable name="reviews_">
11059+
<xsl:for-each select="//*[local-name() = 'review'][@from]">
11060+
<xsl:copy>
11061+
<xsl:copy-of select="@from"/>
11062+
<xsl:copy-of select="@id"/>
11063+
</xsl:copy>
11064+
</xsl:for-each>
11065+
</xsl:variable>
11066+
<xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
11067+
11068+
<xsl:template name="addReviewHelper">
11069+
<!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
11070+
<xsl:variable name="curr_id" select="@id"/>
11071+
<xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
11072+
<xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
11073+
<fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11074+
</xsl:if>
11075+
<!-- <fo:block>
11076+
<curr_id><xsl:value-of select="$curr_id"/></curr_id>
11077+
<xsl:copy-of select="$reviews"/>
11078+
</fo:block> -->
11079+
</xsl:template>
11080+
1105711081
<!-- main sections -->
1105811082
<xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
1105911083

@@ -11062,6 +11086,8 @@
1106211086

1106311087
<xsl:call-template name="sections_element_style"/>
1106411088

11089+
<xsl:call-template name="addReviewHelper"/>
11090+
1106511091
<xsl:apply-templates/>
1106611092
</fo:block>
1106711093

@@ -11097,6 +11123,7 @@
1109711123

1109811124
<fo:block>
1109911125
<xsl:call-template name="setId"/>
11126+
<xsl:call-template name="addReviewHelper"/>
1110011127
<xsl:apply-templates/>
1110111128
</fo:block>
1110211129
</xsl:template>
@@ -11133,6 +11160,8 @@
1113311160

1113411161
<xsl:call-template name="refine_clause_style"/>
1113511162

11163+
<xsl:call-template name="addReviewHelper"/>
11164+
1113611165
<xsl:apply-templates/>
1113711166
</fo:block>
1113811167
</xsl:template>
@@ -11185,6 +11214,23 @@
1118511214

1118611215
<xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
1118711216

11217+
<xsl:if test="1 = 1">
11218+
<xsl:choose>
11219+
<!-- if there isn't the attribute '@from', then -->
11220+
<xsl:when test="$id_from = ''">
11221+
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11222+
</xsl:when>
11223+
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
11224+
<xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
11225+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11226+
</xsl:when>
11227+
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
11228+
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11229+
</xsl:when>
11230+
</xsl:choose>
11231+
</xsl:if>
11232+
11233+
<xsl:if test="1 = 2">
1118811234
<xsl:choose>
1118911235
<!-- if there isn't the attribute '@from', then -->
1119011236
<xsl:when test="$id_from = ''">
@@ -11198,6 +11244,7 @@
1119811244
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
1119911245
</xsl:when>
1120011246
</xsl:choose>
11247+
</xsl:if>
1120111248

1120211249
</xsl:template>
1120311250

0 commit comments

Comments
 (0)