lib/isodoc/m3aawg/m3aawg.policy.xsl in metanorma-m3aawg-1.7.4 vs lib/isodoc/m3aawg/m3aawg.policy.xsl in metanorma-m3aawg-1.7.5

- old
+ new

@@ -1105,11 +1105,11 @@ <xsl:attribute name="margin-top">14pt</xsl:attribute> <xsl:attribute name="margin-bottom">14pt</xsl:attribute> <xsl:attribute name="text-align">justify</xsl:attribute> - + </xsl:attribute-set><xsl:attribute-set name="example-style"> @@ -1172,10 +1172,11 @@ <xsl:attribute name="padding-right">1mm</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="table-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> @@ -1192,10 +1193,12 @@ + </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style"> + </xsl:attribute-set><xsl:attribute-set name="appendix-style"> <xsl:attribute name="font-size">12pt</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="margin-top">12pt</xsl:attribute> @@ -1242,10 +1245,11 @@ + </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style"> @@ -1283,14 +1287,16 @@ + </xsl:attribute-set><xsl:attribute-set name="termnote-name-style"> + </xsl:attribute-set><xsl:attribute-set name="quote-style"> <xsl:attribute name="margin-top">12pt</xsl:attribute> <xsl:attribute name="margin-left">12mm</xsl:attribute> @@ -1341,10 +1347,11 @@ <xsl:attribute name="keep-with-previous">always</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="formula-style"> @@ -1413,10 +1420,12 @@ <xsl:attribute name="text-decoration">line-through</xsl:attribute> </xsl:attribute-set><xsl:attribute-set name="mathml-style"> <xsl:attribute name="font-family">STIX Two Math</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="list-style"> + </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents"> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/> @@ -1470,15 +1479,15 @@ </xsl:variable> <xsl:variable name="table"> <xsl:variable name="simple-table"> - <xsl:call-template name="getSimpleTable"/> + <xsl:call-template name="getSimpleTable"/> </xsl:variable> <!-- <xsl:if test="$namespace = 'bipm'"> - <fo:block>&#xA0;</fo:block> + <fo:block>&#xA0;</fo:block> </xsl:if> --> <!-- $namespace = 'iso' or --> <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> @@ -1576,10 +1585,11 @@ + </xsl:variable> <fo:table id="{@id}" table-omit-footer-at-break="true"> @@ -1717,10 +1727,13 @@ <xsl:param name="continued"/> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="table-name-style"> + + + <xsl:choose> <xsl:when test="$continued = 'true'"> <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> --> </xsl:when> @@ -1864,10 +1877,11 @@ </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process"> <xsl:param name="cols-count"/> <!-- font-weight="bold" --> <fo:table-header> + <xsl:apply-templates/> </fo:table-header> </xsl:template><xsl:template name="table-header-title"> <xsl:param name="cols-count"/> <!-- row for title --> @@ -2109,10 +2123,14 @@ </xsl:if> + + + + <!-- <xsl:if test="$namespace = 'bipm'"> <xsl:attribute name="height">8mm</xsl:attribute> </xsl:if> --> <xsl:apply-templates/> @@ -2194,10 +2212,13 @@ + + + <xsl:if test=".//*[local-name() = 'table']"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> @@ -2409,10 +2430,11 @@ + <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id--> <xsl:value-of select="@reference"/> @@ -2711,10 +2733,11 @@ </xsl:template><xsl:template match="*[local-name()='dt']"> <xsl:param name="key_iso"/> <fo:table-row> + <fo:table-cell> <fo:block margin-top="6pt"> @@ -2726,10 +2749,11 @@ + <xsl:apply-templates/> <!-- <xsl:if test="$namespace = 'gb'"> <xsl:if test="ancestor::*[local-name()='formula']"> <xsl:text>—</xsl:text> </xsl:if> @@ -3278,11 +3302,19 @@ </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> - <mathml:mspace width="0.5ex"/> + <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')"/> @@ -3302,10 +3334,11 @@ </xsl:otherwise> </xsl:choose> </xsl:variable> <fo:inline xsl:use-attribute-sets="link-style"> + <xsl:choose> <xsl:when test="$target_text = ''"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> @@ -3453,10 +3486,11 @@ </fo:block> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template match="*[local-name() = 'termnote']"> <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style"> + <fo:inline xsl:use-attribute-sets="termnote-name-style"> <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> </fo:inline> <xsl:apply-templates/> @@ -3532,10 +3566,11 @@ <xsl:with-param name="isAdded" select="$isAdded"/> <xsl:with-param name="isDeleted" select="$isDeleted"/> </xsl:call-template> <fo:block> + <xsl:apply-templates/> </fo:block> <xsl:call-template name="fn_display_figure"/> <xsl:for-each select="*[local-name() = 'note']"> <xsl:call-template name="note"/> @@ -3816,10 +3851,11 @@ </fo:bookmark> </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="figure-name-style"> + <xsl:apply-templates/> </fo:block> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item"> <xsl:apply-templates mode="contents_item"/> @@ -3896,21 +3932,24 @@ <xsl:text> </xsl:text> </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode"> <fo:block-container margin-left="0mm"> <xsl:copy-of select="@id"/> + <xsl:if test="parent::*[local-name() = 'note']"> <xsl:attribute name="margin-left"> <xsl:choose> <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when> <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:if> <fo:block-container margin-left="0mm"> - + + + <fo:block xsl:use-attribute-sets="sourcecode-style"> <xsl:variable name="_font-size"> @@ -3935,14 +3974,18 @@ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when> <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:if> - <xsl:apply-templates/> - </fo:block> + + <xsl:apply-templates/> + </fo:block> + + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + </fo:block-container> </fo:block-container> </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2"> <xsl:variable name="text"> <xsl:call-template name="add-zero-spaces-equal"/> @@ -4506,10 +4549,11 @@ </xsl:template><xsl:template match="*[local-name() = 'clause']"> <fo:block> <xsl:call-template name="setId"/> + <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'definitions']"> <fo:block id="{@id}"> <xsl:apply-templates/> @@ -4752,21 +4796,21 @@ </xsl:template><xsl:template name="processBibitemDocId"> <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/> <xsl:choose> <xsl:when test="normalize-space($_doc_ident) != ''"> - <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/> + <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/> <xsl:if test="$type != '' and not(contains($_doc_ident, $type))"> <xsl:value-of select="$type"/><xsl:text> </xsl:text> - </xsl:if> + </xsl:if> --> <xsl:value-of select="$_doc_ident"/> </xsl:when> <xsl:otherwise> - <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/> + <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/> <xsl:if test="$type != ''"> <xsl:value-of select="$type"/><xsl:text> </xsl:text> - </xsl:if> + </xsl:if> --> <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template name="processPersonalAuthor"> <xsl:choose> @@ -5268,6 +5312,16 @@ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when> <xsl:when test="$align != ''"> <xsl:value-of select="$align"/> </xsl:when> </xsl:choose> + </xsl:template><xsl:template name="setTextAlignment"> + <xsl:param name="default">left</xsl:param> + <xsl:attribute name="text-align"> + <xsl:choose> + <xsl:when test="@align"><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> + </xsl:attribute> </xsl:template></xsl:stylesheet> \ No newline at end of file