lib/isodoc/un/un.recommendation.xsl in metanorma-un-0.5.8 vs lib/isodoc/un/un.recommendation.xsl in metanorma-un-0.5.9
- old
+ new
@@ -642,19 +642,19 @@
<!-- <xsl:when test="local-name(..) = 'ul'">—</xsl:when> --> <!-- dash -->
<xsl:when test="local-name(..) = 'ul'">•</xsl:when>
<xsl:otherwise> <!-- for ordered lists -->
<xsl:choose>
<xsl:when test="../@type = 'arabic'">
- <xsl:number format="a)"/>
+ <xsl:number format="a)" lang="en"/>
</xsl:when>
<xsl:when test="../@type = 'alphabet'">
<xsl:number format="1)"/>
</xsl:when>
<xsl:when test="ancestor::*[un:annex]">
<xsl:choose>
<xsl:when test="$level = 1">
- <xsl:number format="a)"/>
+ <xsl:number format="a)" lang="en"/>
</xsl:when>
<xsl:when test="$level = 2">
<xsl:number format="i)"/>
</xsl:when>
<xsl:otherwise>
@@ -1600,14 +1600,16 @@
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
<xsl:variable name="colwidths">
- <xsl:call-template name="calculate-column-widths">
- <xsl:with-param name="cols-count" select="$cols-count"/>
- <xsl:with-param name="table" select="$simple-table"/>
- </xsl:call-template>
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
+ <xsl:call-template name="calculate-column-widths">
+ <xsl:with-param name="cols-count" select="$cols-count"/>
+ <xsl:with-param name="table" select="$simple-table"/>
+ </xsl:call-template>
+ </xsl:if>
</xsl:variable>
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
<!-- <xsl:variable name="colwidths2">
<xsl:call-template name="calculate-column-widths">
@@ -1681,20 +1683,29 @@
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
<xsl:if test="$isNoteOrFnExist = 'true'">
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
</xsl:if>
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
- <xsl:choose>
- <xsl:when test=". = 1 or . = 0">
- <fo:table-column column-width="proportional-column-width(2)"/>
- </xsl:when>
- <xsl:otherwise>
- <fo:table-column column-width="proportional-column-width({.})"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
+ <fo:table-column column-width="{@width}"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
+ <xsl:choose>
+ <xsl:when test=". = 1 or . = 0">
+ <fo:table-column column-width="proportional-column-width(2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:table-column column-width="proportional-column-width({.})"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:choose>
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
</xsl:when>
@@ -1703,14 +1714,16 @@
</xsl:otherwise>
</xsl:choose>
</fo:table>
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
<xsl:call-template name="insertTableFooterInSeparateTable">
<xsl:with-param name="table_attributes" select="$table_attributes"/>
<xsl:with-param name="colwidths" select="$colwidths"/>
+ <xsl:with-param name="colgroup" select="$colgroup"/>
</xsl:call-template>
</xsl:for-each>
<!-- insert footer as table -->
<!-- <fo:table>
@@ -1960,16 +1973,26 @@
</xsl:if>
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
<xsl:param name="table_attributes"/>
<xsl:param name="colwidths"/>
+ <xsl:param name="colgroup"/>
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
<xsl:if test="$isNoteOrFnExist = 'true'">
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
+ <xsl:variable name="cols-count">
+ <xsl:choose>
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
<fo:table keep-with-previous="always">
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
<xsl:choose>
<xsl:when test="@name = 'border-top'">
@@ -1983,20 +2006,29 @@
<xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
- <xsl:choose>
- <xsl:when test=". = 1 or . = 0">
- <fo:table-column column-width="proportional-column-width(2)"/>
- </xsl:when>
- <xsl:otherwise>
- <fo:table-column column-width="proportional-column-width({.})"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
+ <fo:table-column column-width="{@width}"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
+ <xsl:choose>
+ <xsl:when test=". = 1 or . = 0">
+ <fo:table-column column-width="proportional-column-width(2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:table-column column-width="proportional-column-width({.})"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
@@ -4226,11 +4258,12 @@
<fo:table-column column-width="20mm"/>
<fo:table-column column-width="23mm"/>
<fo:table-column column-width="107mm"/>
<fo:table-column column-width="15mm"/>
<fo:table-body>
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
+
<fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
<fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
</fo:table-row>
@@ -4244,9 +4277,13 @@
</xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
<fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
<fo:block><xsl:apply-templates/></fo:block>
</fo:table-cell>
</xsl:template><xsl:template name="processBibitem">
+
+
+ <!-- end BIPM bibitem processing-->
+
</xsl:template><xsl:template name="processBibitemDocId">
\ No newline at end of file