lib/isodoc/cc/cc.standard.xsl in metanorma-cc-1.7.8 vs lib/isodoc/cc/cc.standard.xsl in metanorma-cc-1.7.9

- old
+ new

@@ -1081,10 +1081,11 @@ + </xsl:attribute-set><xsl:attribute-set name="termexample-name-style"> <xsl:attribute name="padding-right">10mm</xsl:attribute> @@ -1536,10 +1537,12 @@ <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: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> @@ -1823,14 +1826,14 @@ <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black"> <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"> <xsl:with-param name="continued">true</xsl:with-param> </xsl:apply-templates> - <xsl:for-each select="ancestor::*[local-name()='table'][1]"> - <xsl:call-template name="fn_name_display"/> - </xsl:for-each> + + + </fo:table-cell> </fo:table-row> </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody"> <fo:table-body> <xsl:apply-templates/> @@ -1907,12 +1910,16 @@ <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="isNoteOrFnExistShowAfterTable"> + + </xsl:variable> + <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'"> + <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> @@ -2048,10 +2055,23 @@ <xsl:apply-templates/> <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> --> </fo:table-body> + </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name"> + <xsl:choose> + <xsl:when test="substring-after(., '—') != ''"> + <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name"> + <xsl:apply-templates mode="presentation_name"/> + </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name"> + <xsl:apply-templates select="."/> </xsl:template><xsl:template match="*[local-name()='tr']"> <xsl:variable name="parent-name" select="local-name(..)"/> <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> --> <fo:table-row min-height="4mm"> <xsl:if test="$parent-name = 'thead'"> @@ -2220,18 +2240,16 @@ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process"> <xsl:apply-templates/> </xsl:template><xsl:template name="fn_display"> <xsl:variable name="references"> + <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']"> - <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> - - - <xsl:apply-templates/> - </fn> + <xsl:call-template name="create_fn"/> </xsl:for-each> </xsl:variable> + <xsl:for-each select="xalan:nodeset($references)//fn"> <xsl:variable name="reference" select="@reference"/> <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note--> <fo:block margin-bottom="12pt"> @@ -2263,10 +2281,16 @@ <xsl:copy-of select="./node()"/> </fo:inline> </fo:block> </xsl:if> </xsl:for-each> + </xsl:template><xsl:template name="create_fn"> + <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> + + + <xsl:apply-templates/> + </fn> </xsl:template><xsl:template name="fn_name_display"> <!-- <xsl:variable name="references"> <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']"> <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> <xsl:apply-templates /> @@ -3263,23 +3287,10 @@ </xsl:template><xsl:template match="mathml:mtext" mode="mathml"> <xsl:copy> <!-- replace start and end spaces to non-break space --> <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/> </xsl:copy> - </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml"> - <xsl:copy> - <xsl:apply-templates select="@*|node()" mode="mathml"/> - </xsl:copy> - <xsl:choose> - <!-- if in msub, then don't add space --> - <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/> - <!-- if next char in digit, don't add space --> - <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/> - <xsl:otherwise> - <mathml:mspace width="0.5ex"/> - </xsl:otherwise> - </xsl:choose> </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link"> <xsl:variable name="target"> <xsl:choose> <xsl:when test="@updatetype = 'true'"> <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/> @@ -4455,11 +4466,23 @@ <fo:inline xsl:use-attribute-sets="termexample-name-style"> <xsl:apply-templates/> </fo:inline> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']"> - <fo:inline><xsl:apply-templates/></fo:inline> + <xsl:variable name="element">inline + + </xsl:variable> + <xsl:choose> + <xsl:when test="contains($element, 'block')"> + <fo:block xsl:use-attribute-sets="example-p-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:inline><xsl:apply-templates/></fo:inline> + </xsl:otherwise> + </xsl:choose> </xsl:template><xsl:template match="*[local-name() = 'example']"> <fo:block id="{@id}" xsl:use-attribute-sets="example-style"> <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> @@ -5042,10 +5065,9 @@ <fo:block><xsl:apply-templates/></fo:block> </fo:table-cell> </xsl:template><xsl:template name="processBibitem"> - <!-- end BIPM bibitem processing--> \ No newline at end of file