lib/isodoc/ogc/ogc.white-paper.xsl in metanorma-ogc-2.3.2 vs lib/isodoc/ogc/ogc.white-paper.xsl in metanorma-ogc-2.3.3
- old
+ new
@@ -683,18 +683,18 @@
<!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
You can put such conditions by using xslt construction `xsl:if test="..."` or <xsl:choose><xsl:when test=""></xsl:when><xsl:otherwiste></xsl:otherwiste></xsl:choose>,
BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
<!--
- <misc-container>
+ <metanorma-extension>
<presentation-metadata>
<papersize>letter</papersize>
</presentation-metadata>
- </misc-container>
+ </metanorma-extension>
-->
- <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
+ <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
<xsl:variable name="papersize_width_">
<xsl:choose>
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
<xsl:when test="$papersize = 'a4'">210</xsl:when>
</xsl:choose>
@@ -807,31 +807,31 @@
</xsl:variable>
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
<xsl:variable name="title-list-tables">
- <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
+ <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
<xsl:value-of select="$toc_table_title"/>
<xsl:if test="normalize-space($toc_table_title) = ''">
<xsl:call-template name="getTitle">
<xsl:with-param name="name" select="'title-list-tables'"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:variable name="title-list-figures">
- <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
+ <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
<xsl:value-of select="$toc_figure_title"/>
<xsl:if test="normalize-space($toc_figure_title) = ''">
<xsl:call-template name="getTitle">
<xsl:with-param name="name" select="'title-list-figures'"/>
</xsl:call-template>
</xsl:if>
</xsl:variable>
<xsl:variable name="title-list-recommendations">
- <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
+ <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
<xsl:value-of select="$toc_requirement_title"/>
<xsl:if test="normalize-space($toc_requirement_title) = ''">
<xsl:call-template name="getTitle">
<xsl:with-param name="name" select="'title-list-recommendations'"/>
</xsl:call-template>
@@ -899,11 +899,11 @@
<xsl:template name="insertRootStyle">
<xsl:param name="root-style"/>
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
<xsl:variable name="additional_fonts_">
- <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
+ <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
@@ -2068,14 +2068,14 @@
</xsl:for-each>
</xsl:template>
<xsl:template name="processTablesFigures_Contents">
<xsl:param name="always"/>
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
<xsl:call-template name="processTables_Contents"/>
</xsl:if>
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
<xsl:call-template name="processFigures_Contents"/>
</xsl:if>
</xsl:template>
<xsl:template name="processTables_Contents">
@@ -2437,10 +2437,12 @@
<xsl:attribute name="margin-right">0mm</xsl:attribute>
</xsl:if>
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
+ <xsl:call-template name="setBordersTableArray"/>
+
</xsl:element>
</xsl:variable>
<xsl:if test="$isGenerateTableIF = 'true'">
<!-- to determine start of table -->
@@ -2580,10 +2582,14 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
+ <xsl:template name="setBordersTableArray">
+
+ </xsl:template>
+
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
<xsl:param name="continued"/>
<xsl:if test="normalize-space() != ''">
<fo:block xsl:use-attribute-sets="table-name-style">
@@ -3054,10 +3060,12 @@
<fo:table-body>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
+ <xsl:call-template name="setBordersTableArray"/>
+
<!-- fn will be processed inside 'note' processing -->
<!-- for BSI (not PAS) display Notes before footnotes -->
<!-- except gb and bsi -->
@@ -3175,10 +3183,12 @@
<!-- ===================== -->
<!-- row in table header (thead) -->
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
+ <xsl:call-template name="setBordersTableArray"/>
+
<xsl:call-template name="setTableRowAttributes"/>
<xsl:apply-templates/>
</fo:table-row>
</xsl:template>
@@ -3198,10 +3208,12 @@
<xsl:if test="count(*) = count(*[local-name() = 'th'])"> <!-- row contains 'th' only -->
<xsl:attribute name="keep-with-next">always</xsl:attribute>
</xsl:if>
+ <xsl:call-template name="setBordersTableArray"/>
+
<xsl:call-template name="setTableRowAttributes"/>
<xsl:apply-templates/>
</fo:table-row>
</xsl:template>
@@ -3217,10 +3229,12 @@
<fo:table-cell xsl:use-attribute-sets="table-header-cell-style"> <!-- text-align="{@align}" -->
<xsl:call-template name="setTextAlignment">
<xsl:with-param name="default">center</xsl:with-param>
</xsl:call-template>
+ <xsl:call-template name="setBordersTableArray"/>
+
<xsl:if test="$lang = 'ar'">
<xsl:attribute name="padding-right">1mm</xsl:attribute>
</xsl:if>
<xsl:call-template name="setTableCellAttributes"/>
@@ -3269,10 +3283,12 @@
<xsl:attribute name="padding-right">1mm</xsl:attribute>
</xsl:if>
<!-- bsi -->
+ <xsl:call-template name="setBordersTableArray"/>
+
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
<xsl:attribute name="padding-right">1mm</xsl:attribute>
</xsl:if>
<xsl:call-template name="setTableCellAttributes"/>
@@ -6916,11 +6932,11 @@
<!-- =============== -->
<!-- sourcecode -->
<!-- =============== -->
- <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
<xsl:template match="*[local-name() = 'property']" mode="css">
<xsl:attribute name="{@name}">
@@ -9006,12 +9022,12 @@
<!-- Table of Contents (ToC) processing -->
<!-- =================== -->
<xsl:variable name="toc_level">
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
- <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
- <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
+ <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
+ <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
<xsl:choose>
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
<xsl:otherwise><!-- default value -->
3
@@ -9999,9 +10015,10 @@
<xsl:variable name="align" select="normalize-space(@align)"/>
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
+ <xsl:when test="$align = 'justified'">justify</xsl:when>
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
</xsl:choose>
\ No newline at end of file