lib/isodoc/itu/itu.resolution.xsl in metanorma-itu-2.1.11 vs lib/isodoc/itu/itu.resolution.xsl in metanorma-itu-2.1.12

- old
+ new

@@ -217,11 +217,11 @@ <xsl:if test="$doctype = 'technical-report' or $doctype = 'technical-paper' or $doctype = 'implementers-guide'"> <fo:page-sequence master-reference="TR-first-page"> <fo:flow flow-name="xsl-region-body"> <fo:block> - <fo:table width="175mm" table-layout="fixed" border-top="1.5pt solid black"> + <fo:table width="175mm" table-layout="fixed" border-top="1.5pt solid black" id="__internal_layout__meeting_{generate-id()}"> <fo:table-column column-width="29mm"/> <fo:table-column column-width="45mm"/> <fo:table-column column-width="28mm"/> <fo:table-column column-width="72mm"/> <fo:table-body> @@ -250,11 +250,11 @@ </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> - <fo:table width="175mm" table-layout="fixed"> + <fo:table width="175mm" table-layout="fixed" id="__internal_layout__groups_{generate-id()}"> <fo:table-column column-width="29mm"/> <fo:table-column column-width="10mm"/> <fo:table-column column-width="35mm"/> <fo:table-column column-width="9mm"/> <fo:table-column column-width="83mm"/> @@ -298,11 +298,11 @@ </fo:table-row> </fo:table-body> </fo:table> <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:person"> - <fo:table width="175mm" table-layout="fixed" line-height="110%"> + <fo:table width="175mm" table-layout="fixed" line-height="110%" id="__internal_layout__person_{generate-id()}"> <fo:table-column column-width="29mm"/> <fo:table-column column-width="75mm"/> <fo:table-column column-width="71mm"/> <fo:table-body> @@ -536,11 +536,11 @@ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Fond-Rec))}" width="43.6mm" content-height="299.2mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Cover Page"/> </fo:block> </fo:block-container> <fo:block-container font-family="Arial"> <xsl:variable name="annexid" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid)"/> - <fo:table width="100%" table-layout="fixed"> <!-- 175.4mm--> + <fo:table width="100%" table-layout="fixed" id="__internal_layout__coverpage_{generate-id()}"> <!-- 175.4mm--> <fo:table-column column-width="25.2mm"/> <fo:table-column column-width="44.4mm"/> <fo:table-column column-width="35.8mm"/> <fo:table-column column-width="67mm"/> <fo:table-body> @@ -2465,10 +2465,18 @@ <xsl:attribute name="margin-top">6pt</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> </xsl:attribute-set> + <xsl:attribute-set name="pre-style"> + <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + + <xsl:attribute name="margin-top">6pt</xsl:attribute> + + </xsl:attribute-set> + <xsl:attribute-set name="permission-style"> </xsl:attribute-set> <xsl:attribute-set name="permission-name-style"> @@ -2568,10 +2576,15 @@ <xsl:variable name="table-border_"> </xsl:variable> <xsl:variable name="table-border" select="normalize-space($table-border_)"/> + <xsl:variable name="table-cell-border_"> + + </xsl:variable> + <xsl:variable name="table-cell-border" select="normalize-space($table-cell-border_)"/> + <xsl:attribute-set name="table-container-style"> <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-right">0mm</xsl:attribute> <xsl:attribute name="font-size">10pt</xsl:attribute> @@ -2580,12 +2593,10 @@ </xsl:attribute-set> <!-- table-container-style --> <xsl:attribute-set name="table-style"> <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute> <xsl:attribute name="table-layout">fixed</xsl:attribute> - <xsl:attribute name="margin-left">0mm</xsl:attribute> - <xsl:attribute name="margin-right">0mm</xsl:attribute> </xsl:attribute-set><!-- table-style --> <xsl:attribute-set name="table-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> @@ -3696,10 +3707,16 @@ </xsl:variable> <xsl:variable name="table_attributes"> <xsl:element name="table_attributes" use-attribute-sets="table-style"> + + <xsl:if test="$margin-side != 0"> + <xsl:attribute name="margin-left">0mm</xsl:attribute> + <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:if test="$doctype = 'service-publication'"> <xsl:attribute name="border">1pt solid rgb(211,211,211)</xsl:attribute> </xsl:if> @@ -4479,10 +4496,14 @@ <!-- row in table's body (tbody) --> <xsl:template match="*[local-name()='tr']"> <fo:table-row xsl:use-attribute-sets="table-body-row-style"> + <xsl:if test="*[local-name() = 'th']"> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + </xsl:if> + <xsl:call-template name="setTableRowAttributes"/> <xsl:apply-templates/> </fo:table-row> </xsl:template> @@ -6490,10 +6511,13 @@ <xsl:param name="str"/> <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/> <xsl:value-of select="substring($str, 2)"/> </xsl:template> + <!-- ======================================= --> + <!-- math --> + <!-- ======================================= --> <xsl:template match="mathml:math"> <xsl:variable name="isAdded" select="@added"/> <xsl:variable name="isDeleted" select="@deleted"/> <fo:inline xsl:use-attribute-sets="mathml-style"> @@ -6540,18 +6564,61 @@ <xsl:variable name="comment_text_2" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/> <xsl:variable name="comment_text" select="java:trim(java:java.lang.String.new($comment_text_2))"/> <xsl:value-of select="$comment_text"/> </xsl:template> + <xsl:template match="*[local-name() = 'asciimath']"> + <xsl:param name="process" select="'false'"/> + <xsl:if test="$process = 'true'"> + <xsl:apply-templates/> + </xsl:if> + </xsl:template> + + <xsl:template match="*[local-name() = 'latexmath']"/> + + <xsl:template name="getMathml_asciimath_text"> + <xsl:variable name="asciimath" select="../*[local-name() = 'asciimath']"/> + <xsl:variable name="latexmath"> + + </xsl:variable> + <xsl:variable name="asciimath_text_following"> + <xsl:choose> + <xsl:when test="normalize-space($latexmath) != ''"> + <xsl:value-of select="$latexmath"/> + </xsl:when> + <xsl:when test="normalize-space($asciimath) != ''"> + <xsl:value-of select="$asciimath"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="following-sibling::node()[1][self::comment()]"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="asciimath_text_"> + <xsl:choose> + <xsl:when test="normalize-space($asciimath_text_following) != ''"> + <xsl:value-of select="$asciimath_text_following"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="asciimath_text_2" select="java:org.metanorma.fop.Util.unescape($asciimath_text_)"/> + <xsl:variable name="asciimath_text" select="java:trim(java:java.lang.String.new($asciimath_text_2))"/> + <xsl:value-of select="$asciimath_text"/> + </xsl:template> + <xsl:template name="mathml_instream_object"> - <xsl:param name="comment_text"/> + <xsl:param name="asciimath_text"/> <xsl:param name="mathml_content"/> - <xsl:variable name="comment_text_"> + <xsl:variable name="asciimath_text_"> <xsl:choose> - <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when> - <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> + <xsl:when test="normalize-space($asciimath_text) != ''"><xsl:value-of select="$asciimath_text"/></xsl:when> + <!-- <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> --> + <xsl:otherwise><xsl:call-template name="getMathml_asciimath_text"/></xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="mathml"> <xsl:apply-templates select="." mode="mathml"/> @@ -6564,14 +6631,14 @@ <xsl:attribute name="fox:actual-text"> <xsl:value-of select="$mathml_content"/> </xsl:attribute> <!-- <xsl:if test="$add_math_as_text = 'true'"> --> - <xsl:if test="normalize-space($comment_text_) != ''"> + <xsl:if test="normalize-space($asciimath_text_) != ''"> <!-- put Mathin Alternate Text --> <xsl:attribute name="fox:alt-text"> - <xsl:value-of select="$comment_text_"/> + <xsl:value-of select="$asciimath_text_"/> </xsl:attribute> </xsl:if> <!-- </xsl:if> --> <xsl:copy-of select="xalan:nodeset($mathml)"/> @@ -6640,10 +6707,33 @@ <!-- patch: slash in the mtd wrong rendering --> <xsl:template match="mathml:mtd/mathml:mo/text()[. = '/']" mode="mathml"> <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/> </xsl:template> + <!-- Examples: + <stem type="AsciiMath">x = 1</stem> + <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem> + <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem> + --> + <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3"> + <fo:inline xsl:use-attribute-sets="mathml-style"> + + <xsl:choose> + <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when> + <xsl:otherwise> + <xsl:apply-templates> + <xsl:with-param name="process">true</xsl:with-param> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + + </fo:inline> + </xsl:template> + <!-- ======================================= --> + <!-- END: math --> + <!-- ======================================= --> + <xsl:template match="*[local-name()='localityStack']"/> <xsl:template match="*[local-name()='link']" name="link"> <xsl:variable name="target"> <xsl:choose> @@ -7984,13 +8074,13 @@ <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output --> <xsl:template match="*[local-name() = 'span']" mode="contents_item"> <xsl:apply-templates mode="contents_item"/> </xsl:template> - <!-- ====== --> - <!-- sourcecode --> - <!-- ====== --> + <!-- =============== --> + <!-- sourcecode --> + <!-- =============== --> <xsl:template match="*[local-name()='sourcecode']" name="sourcecode"> <fo:block-container xsl:use-attribute-sets="sourcecode-container-style"> <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']"> @@ -8285,13 +8375,27 @@ <fo:block xsl:use-attribute-sets="sourcecode-name-style"> <xsl:apply-templates/> </fo:block> </xsl:if> </xsl:template> - <!-- ====== --> - <!-- ====== --> + <!-- =============== --> + <!-- END sourcecode --> + <!-- =============== --> + <!-- =============== --> + <!-- pre --> + <!-- =============== --> + <xsl:template match="*[local-name()='pre']" name="pre"> + <fo:block xsl:use-attribute-sets="pre-style"> + <xsl:copy-of select="@id"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + <!-- =============== --> + <!-- pre --> + <!-- =============== --> + <!-- ========== --> <!-- permission --> <!-- ========== --> <xsl:template match="*[local-name() = 'permission']"> <fo:block id="{@id}" xsl:use-attribute-sets="permission-style"> @@ -9784,11 +9888,11 @@ <fo:table width="100%" table-layout="fixed"> <fo:table-column column-width="20%"/> <fo:table-column column-width="80%"/> <fo:table-body> <fo:table-row> - <fo:table-cell><fo:block><xsl:copy-of select="$bibitem_label"/></fo:block></fo:table-cell> + <fo:table-cell><fo:block><xsl:value-of select="$bibitem_label"/></fo:block></fo:table-cell> <fo:table-cell><fo:block><xsl:copy-of select="$bibitem_body"/></fo:block></fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </xsl:when> <!-- $doctype = 'implementers-guide' --> @@ -9801,11 +9905,11 @@ <xsl:otherwise> <fo:list-block provisional-distance-between-starts="14mm"> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block> - <xsl:copy-of select="$bibitem_label"/> + <xsl:value-of select="$bibitem_label"/> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> <fo:block> <xsl:copy-of select="$bibitem_body"/> @@ -10874,16 +10978,17 @@ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="setId"> + <xsl:param name="prefix"/> <xsl:attribute name="id"> <xsl:choose> <xsl:when test="@id"> - <xsl:value-of select="@id"/> + <xsl:value-of select="concat($prefix, @id)"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="generate-id()"/> + <xsl:value-of select="concat($prefix, generate-id())"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:template> \ No newline at end of file