lib/isodoc/un/un.plenary-attachment.xsl in metanorma-un-0.8.0 vs lib/isodoc/un/un.plenary-attachment.xsl in metanorma-un-0.8.1

- old
+ new

@@ -43,11 +43,11 @@ <xsl:variable name="id" select="/un:un-standard/un:bibdata/un:ext/un:session/un:id"/> <xsl:template match="/"> <xsl:call-template name="namespaceCheck"/> - <fo:root font-family="Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}"> + <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}"> <fo:layout-master-set> <!-- Cover page --> <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm"> <fo:region-body margin-top="17.5mm" margin-bottom="10mm" margin-left="20mm" margin-right="20mm"/> <fo:region-before extent="17.5mm"/> @@ -323,13 +323,10 @@ <!-- ============================= --> <!-- CONTENTS --> <!-- ============================= --> - <xsl:template match="node()" mode="contents"> - <xsl:apply-templates mode="contents"/> - </xsl:template> <!-- element with title --> <xsl:template match="*[un:title]" mode="contents"> <xsl:variable name="level"> <xsl:call-template name="getLevel"> @@ -568,11 +565,11 @@ <xsl:template match="un:ul//un:note | un:ol//un:note" priority="2"/> <xsl:template match="un:ul//un:note/un:name | un:ol//un:note/un:name" mode="process" priority="2"/> <xsl:template match="un:ul//un:note/un:p | un:ol//un:note/un:p" mode="process" priority="2"> <fo:block margin-top="4pt"> - <xsl:apply-templates select="../un:name" mode="presentation"/> + <xsl:apply-templates select="../un:name"/> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="un:ul//un:note/* | un:ol//un:note/*" mode="process"> @@ -642,36 +639,10 @@ <xsl:call-template name="link"/> </fo:inline> </xsl:template> - <xsl:template match="un:admonition"> - <fo:block text-align="center" font-style="italic" keep-with-next="always" margin-bottom="6pt"> - <xsl:apply-templates select="un:name" mode="process"/> - </fo:block> - <fo:block-container border="0.25pt solid black" margin-left="-3mm" margin-right="-3mm" padding-top="4mm"> - <fo:block id="{@id}" font-weight="bold" margin-left="6mm" margin-right="6mm" keep-with-next="always"> - <xsl:apply-templates select="un:name" mode="process"/> - </fo:block> - <fo:block-container margin-left="2mm" margin-right="2mm"> - <fo:block-container margin-left="0mm" margin-right="0mm"> - <xsl:apply-templates/> - </fo:block-container> - </fo:block-container> - </fo:block-container> - <fo:block margin-bottom="4pt"> </fo:block> - </xsl:template> - - <xsl:template match="un:admonition/un:name"/> - <xsl:template match="un:admonition/un:name" mode="process"> - <xsl:apply-templates/> - </xsl:template> - - <xsl:template match="un:admonition/un:p"> - <fo:block text-align="justify" margin-bottom="6pt" line-height="122%"><xsl:apply-templates/></fo:block> - </xsl:template> - <!-- ============================= --> <!-- ============================= --> @@ -808,46 +779,17 @@ <!-- ============================ --> <!-- for further use --> <!-- ============================ --> - - - <xsl:template match="un:bibitem"> - <fo:block id="{@id}" margin-top="6pt" margin-left="14mm" text-indent="-14mm"> - <fo:inline padding-right="5mm">[<xsl:value-of select="un:docidentifier"/>]</fo:inline><xsl:value-of select="un:docidentifier"/> - <xsl:if test="un:title"> - <fo:inline font-style="italic"> - <xsl:text>, </xsl:text> - <xsl:choose> - <xsl:when test="un:title[@type = 'main' and @language = 'en']"> - <xsl:value-of select="un:title[@type = 'main' and @language = 'en']"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="un:title"/> - </xsl:otherwise> - </xsl:choose> - </fo:inline> - </xsl:if> - <xsl:apply-templates select="un:formattedref"/> - </fo:block> - </xsl:template> - <xsl:template match="un:bibitem/un:docidentifier"/> - - <xsl:template match="un:bibitem/un:title"/> - - <xsl:template match="un:formattedref"> - <xsl:text>, </xsl:text><xsl:apply-templates/> - </xsl:template> - <xsl:template match="un:figure" priority="2"> <fo:block-container id="{@id}"> <fo:block> - <xsl:apply-templates/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - <xsl:apply-templates select="un:name" mode="presentation"/> + <xsl:apply-templates select="un:name"/> <!-- <xsl:call-template name="fn_display_figure"/> --> <xsl:for-each select="un:note"> <xsl:call-template name="note"/> </xsl:for-each> </fo:block-container> @@ -954,16 +896,16 @@ <fo:block text-align="center"> <xsl:if test="ancestor::un:annex"> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="margin-left">7mm</xsl:attribute> </xsl:if> - <xsl:apply-templates/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> </fo:table-cell> <fo:table-cell> <!-- display-align="center" --> <fo:block text-align="right"> - <xsl:apply-templates select="un:name" mode="presentation"/> + <xsl:apply-templates select="un:name"/> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> @@ -977,19 +919,10 @@ <xsl:template match="un:formula" mode="process"> <xsl:call-template name="formula-un"/> </xsl:template> - - <xsl:template match="un:references"> - <fo:block> - <xsl:if test="not(un:title)"> - <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> - </xsl:if> - <xsl:apply-templates/> - </fo:block> - </xsl:template> <xsl:template match="un:dl" priority="2"> <fo:block-container margin-left="0mm"> <xsl:if test="parent::*[local-name() = 'note']"> <xsl:attribute name="margin-left"> @@ -1087,37 +1020,36 @@ <xsl:variable name="Image-Recycle"> <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAJkAAAAmCAYAAADXwDkaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA+lpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJNaWNyb3NvZnTCriBXb3JkIDIwMTYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzM0NUVBQ0U2RUMzMTFFQUIzQjg4RDg3OEE1NEI2QzAiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzM0NUVBQ0Y2RUMzMTFFQUIzQjg4RDg3OEE1NEI2QzAiPiA8ZGM6Y3JlYXRvcj4gPHJkZjpTZXE+IDxyZGY6bGk+RGhhbmplZTwvcmRmOmxpPiA8L3JkZjpTZXE+IDwvZGM6Y3JlYXRvcj4gPGRjOnRpdGxlPiA8cmRmOkFsdD4gPHJkZjpsaSB4bWw6bGFuZz0ieC1kZWZhdWx0Ij4xODAxNzYzPC9yZGY6bGk+IDwvcmRmOkFsdD4gPC9kYzp0aXRsZT4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVm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</xsl:text> </xsl:variable> -<xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_"> +<xsl:variable name="titles_"> <title-edition lang="en"> - <xsl:text>Edition </xsl:text> - - + <xsl:text>Edition </xsl:text> + </title-edition> <title-edition lang="fr"> - - <xsl:text>Édition </xsl:text> - + <xsl:text>Édition </xsl:text> </title-edition> - <!-- These titles of Table of contents renders different than determined in localized-strings --> <title-toc lang="en"> </title-toc> <title-toc lang="fr"> + <xsl:text>Sommaire</xsl:text> + </title-toc> + <title-toc lang="zh"> + <xsl:text>Contents</xsl:text> + </title-toc> - - <title-descriptors lang="en">Descriptors</title-descriptors> <title-part lang="en"> @@ -1129,16 +1061,12 @@ </title-part> <title-part lang="zh">第 # 部分:</title-part> - <title-subpart lang="en"> - - </title-subpart> - <title-subpart lang="fr"> - - </title-subpart> + <title-subpart lang="en">Sub-part #</title-subpart> + <title-subpart lang="fr">Partie de sub #</title-subpart> <title-list-tables lang="en">List of Tables</title-list-tables> <title-list-figures lang="en">List of Figures</title-list-figures> @@ -1149,11 +1077,11 @@ <title-summary lang="en">Summary</title-summary> <title-continued lang="en">(continued)</title-continued> <title-continued lang="fr">(continué)</title-continued> - </xsl:variable><xsl:variable name="bibdata"> + </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata"> <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/> <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/> </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle"> <xsl:param name="name"/> <xsl:param name="lang"/> @@ -1178,33 +1106,60 @@ </xsl:otherwise> </xsl:choose> </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style"> + + + + + + + + + + + + + + + <xsl:attribute name="font-family">Times New Roman, STIX Two Math, Source Han Sans</xsl:attribute> + <xsl:attribute name="font-size">10pt</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="link-style"> + </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style"> + <xsl:attribute name="margin-left">0mm</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="sourcecode-style"> <xsl:attribute name="white-space">pre</xsl:attribute> <xsl:attribute name="wrap-option">wrap</xsl:attribute> <xsl:attribute name="role">Code</xsl:attribute> - <xsl:attribute name="font-family">Courier New</xsl:attribute> - <xsl:attribute name="margin-top">6pt</xsl:attribute> - <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + + + + + + + <xsl:attribute name="font-family">Courier New</xsl:attribute> + <xsl:attribute name="margin-top">6pt</xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="permission-style"> </xsl:attribute-set><xsl:attribute-set name="permission-name-style"> </xsl:attribute-set><xsl:attribute-set name="permission-label-style"> @@ -1307,11 +1262,65 @@ </xsl:attribute-set><xsl:variable name="table-border_"> - </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style"> + </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-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="margin-bottom">18pt</xsl:attribute> + <xsl:attribute name="font-size">8pt</xsl:attribute> + + + + </xsl:attribute-set><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 name="border-top">0.5pt solid black</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="table-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> @@ -1330,12 +1339,171 @@ + </xsl:attribute-set><xsl:attribute-set name="table-row-style"> + <xsl:attribute name="min-height">4mm</xsl:attribute> + + + + + </xsl:attribute-set><xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style"> + + + + </xsl:attribute-set><xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style"> + + </xsl:attribute-set><xsl:attribute-set name="table-header-cell-style"> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="border">solid black 1pt</xsl:attribute> + <xsl:attribute name="padding-left">1mm</xsl:attribute> + <xsl:attribute name="display-align">center</xsl:attribute> + + + + + + + + + + + + + <xsl:attribute name="display-align">center</xsl:attribute> + <xsl:attribute name="font-style">italic</xsl:attribute> + <xsl:attribute name="font-weight">normal</xsl:attribute> + <xsl:attribute name="padding-top">2mm</xsl:attribute> + <xsl:attribute name="padding-left">2mm</xsl:attribute> + <xsl:attribute name="border">solid black 0pt</xsl:attribute> + <xsl:attribute name="border-top">solid black 0.2pt</xsl:attribute> + <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute> + <xsl:attribute name="text-indent">0mm</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="table-cell-style"> + <xsl:attribute name="display-align">center</xsl:attribute> + <xsl:attribute name="border">solid black 1pt</xsl:attribute> + <xsl:attribute name="padding-left">1mm</xsl:attribute> + + + + + + + + + + + + + <xsl:attribute name="display-align">before</xsl:attribute> + <xsl:attribute name="padding-left">0mm</xsl:attribute> + <xsl:attribute name="padding-top">2mm</xsl:attribute> + <xsl:attribute name="padding-bottom">1mm</xsl:attribute> + <xsl:attribute name="border">solid black 0pt</xsl:attribute> + <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute> + <xsl:attribute name="text-indent">0mm</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style"> + <xsl:attribute name="border">solid black 1pt</xsl:attribute> + <xsl:attribute name="padding-left">1mm</xsl:attribute> + <xsl:attribute name="padding-right">1mm</xsl:attribute> + <xsl:attribute name="padding-top">1mm</xsl:attribute> + + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="table-note-style"> + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="table-fn-style"> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + + + + + </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style"> + <xsl:attribute name="font-size">80%</xsl:attribute> + <xsl:attribute name="padding-right">5mm</xsl:attribute> + + + + + + + + + + + + + <xsl:attribute name="vertical-align">super</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="fn-container-body-style"> + <xsl:attribute name="text-indent">0</xsl:attribute> + <xsl:attribute name="start-indent">0</xsl:attribute> + + + <xsl:attribute name="margin-left">-8mm</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="table-fn-body-style"> + + </xsl:attribute-set><xsl:attribute-set name="figure-fn-number-style"> + <xsl:attribute name="font-size">80%</xsl:attribute> + <xsl:attribute name="padding-right">5mm</xsl:attribute> + <xsl:attribute name="vertical-align">super</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="figure-fn-body-style"> + <xsl:attribute name="text-align">justify</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="dt-row-style"> + + + </xsl:attribute-set><xsl:attribute-set name="dt-style"> + <xsl:attribute name="margin-top">6pt</xsl:attribute> + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="appendix-style"> </xsl:attribute-set><xsl:attribute-set name="appendix-example-style"> @@ -1391,10 +1559,11 @@ <xsl:attribute name="padding-right">4mm</xsl:attribute> </xsl:attribute-set><xsl:attribute-set name="table-note-name-style"> + <xsl:attribute name="padding-right">2mm</xsl:attribute> </xsl:attribute-set><xsl:attribute-set name="note-p-style"> @@ -1448,17 +1617,22 @@ + </xsl:attribute-set><xsl:attribute-set name="termsource-text-style"> + + </xsl:attribute-set><xsl:attribute-set name="origin-style"> </xsl:attribute-set><xsl:attribute-set name="term-style"> + </xsl:attribute-set><xsl:attribute-set name="figure-style"> + </xsl:attribute-set><xsl:attribute-set name="figure-name-style"> @@ -1554,10 +1728,21 @@ </xsl:attribute-set><xsl:attribute-set name="list-style"> </xsl:attribute-set><xsl:attribute-set name="toc-style"> <xsl:attribute name="line-height">135%</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="fn-reference-style"> + <xsl:attribute name="font-size">80%</xsl:attribute> + <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="fn-style"> <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> </xsl:attribute-set><xsl:attribute-set name="fn-num-style"> <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> @@ -1628,34 +1813,209 @@ <xsl:attribute name="font-size">60%</xsl:attribute> <xsl:attribute name="vertical-align">super</xsl:attribute> <xsl:attribute name="padding-right">8mm</xsl:attribute> - </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:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="OLD_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"/> - <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/> - </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents"> + </xsl:attribute-set><xsl:attribute-set name="admonition-style"> + + + + + + + + + + + + + + <xsl:attribute name="border">0.25pt solid black</xsl:attribute> + <xsl:attribute name="margin-left">-3mm</xsl:attribute> + <xsl:attribute name="margin-right">-3mm</xsl:attribute> + <xsl:attribute name="padding-top">4mm</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="admonition-container-style"> + + + + + + + + + + <xsl:attribute name="margin-left">2mm</xsl:attribute> + <xsl:attribute name="margin-right">2mm</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="admonition-name-style"> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + + + + + + + + + + + + + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="font-style">italic</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="admonition-p-style"> + + + + + + + + + + + <xsl:attribute name="text-align">justify</xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + <xsl:attribute name="line-height">122%</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-style"> + + + + + + + + + + + + + + + + + + + <xsl:attribute name="margin-top">6pt</xsl:attribute> + <xsl:attribute name="margin-left">14mm</xsl:attribute> + <xsl:attribute name="text-indent">-14mm</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-style"> + <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style"> + + + + + </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-style"> + <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style"> + + + </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style"> + + + </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style"> + <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> + <xsl:attribute name="font-size">65%</xsl:attribute> + + + + + + + + + + + + + + + + + <xsl:attribute name="vertical-align">super</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-number-style"> + <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute> + + + + + + + + + + + + + + + + + <xsl:attribute name="font-size">60%</xsl:attribute> + <xsl:attribute name="vertical-align">super</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-body-style"> + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + <xsl:attribute name="start-indent">0pt</xsl:attribute> + + + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="references-non-normative-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:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents"> <xsl:for-each select="/*/*[local-name()='preface']/*"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> - </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents"> - <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/> - - <!-- Normative references --> - <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/> - <!-- Terms and definitions --> - <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/> - <!-- Another main sections --> - <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/> - <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/> - <!-- Bibliography --> - <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/> - </xsl:template><xsl:template name="processMainSectionsDefault_Contents"> <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="contents"/> @@ -1668,33 +2028,15 @@ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> - </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault"> - <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/> - <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/> - <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/> - <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/> - <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/> </xsl:template><xsl:template name="processPrefaceSectionsDefault"> <xsl:for-each select="/*/*[local-name()='preface']/*"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="."/> </xsl:for-each> - </xsl:template><xsl:template name="OLD_processMainSectionsDefault"> - <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/> - - <!-- Normative references --> - <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/> - <!-- Terms and definitions --> - <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/> - <!-- Another main sections --> - <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/> - <xsl:apply-templates select="/*/*[local-name()='annex']"/> - <!-- Bibliography --> - <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/> </xsl:template><xsl:template name="processMainSectionsDefault"> <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="."/> @@ -1727,153 +2069,118 @@ <xsl:variable name="simple-table"> <xsl:call-template name="getSimpleTable"/> </xsl:variable> - <!-- <xsl:if test="$namespace = 'bipm'"> - <fo:block>&#xA0;</fo:block> - </xsl:if> --> - <!-- Display table's name before table as standalone block --> <!-- $namespace = 'iso' or --> - <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + <xsl:apply-templates select="*[local-name()='name']"/> <!-- table's title rendered before table --> + - - - - <xsl:call-template name="fn_name_display"/> - + <xsl:call-template name="table_name_fn_display"/> <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/> - <!-- <xsl:variable name="cols-count"> - <xsl:choose> - <xsl:when test="*[local-name()='thead']"> - <xsl:call-template name="calculate-columns-numbers"> - <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:call-template name="calculate-columns-numbers"> - <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> --> - <!-- cols-count=<xsl:copy-of select="$cols-count"/> --> - <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> --> - <xsl:variable name="colwidths"> <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"> - <xsl:with-param name="cols-count" select="$cols-count"/> - </xsl:call-template> - </xsl:variable> --> - <!-- cols-count=<xsl:copy-of select="$cols-count"/> - colwidthsNew=<xsl:copy-of select="$colwidths"/> - colwidthsOld=<xsl:copy-of select="$colwidths2"/>z --> - - <xsl:variable name="margin-left"> + <xsl:variable name="margin-side"> <xsl:choose> <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> </xsl:variable> - <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm"> + <fo:block-container xsl:use-attribute-sets="table-container-style"> + + <xsl:attribute name="margin-left"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute> + <xsl:attribute name="margin-right"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute> + - - + - <xsl:attribute name="margin-bottom">18pt</xsl:attribute> - <xsl:attribute name="font-size">8pt</xsl:attribute> - + - + + <!-- end table block-container attributes --> - - - - <!-- display table's name before table for PAS inside block-container (2-columnn layout) --> + <xsl:variable name="table_width_default">100%</xsl:variable> <xsl:variable name="table_width"> <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) --> - - - <xsl:choose> - <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when> - <xsl:otherwise>100%</xsl:otherwise> - </xsl:choose> - + <xsl:choose> + <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when> + <xsl:otherwise><xsl:value-of select="$table_width_default"/></xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="table_attributes"> - <attribute name="table-layout">fixed</attribute> - <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute> - <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute> - <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute> - - - - - - - - - - - <attribute name="border-top">0.5pt solid black</attribute> - - - - - + + <xsl:element name="table_attributes" use-attribute-sets="table-style"> + <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute> + + + <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute> + <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute> + + + + + + + + + + + + + + </xsl:element> </xsl:variable> - <fo:table id="{@id}" table-omit-footer-at-break="true"> + <fo:table id="{@id}"> - <xsl:for-each select="xalan:nodeset($table_attributes)/attribute"> - <xsl:attribute name="{@name}"> + <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*"> + <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> <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> @@ -1895,11 +2202,11 @@ <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> <xsl:otherwise> - <xsl:apply-templates/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </xsl:otherwise> </xsl:choose> </fo:table> @@ -1910,29 +2217,10 @@ <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> - <xsl:for-each select="xalan::nodeset($table_attributes)/attribute"> - <xsl:attribute name="{@name}"> - <xsl:value-of select="."/> - </xsl:attribute> - </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> - </fo:table>--> @@ -1986,22 +2274,21 @@ </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation"> + </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"> + - <xsl:choose> <xsl:when test="$continued = 'true'"> - <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> --> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> @@ -2060,17 +2347,10 @@ </xsl:when> <xsl:otherwise> <xsl:for-each select="xalan:nodeset($table)/*/tr"> <xsl:variable name="td_text"> <xsl:apply-templates select="td[$curr-col]" mode="td_text"/> - - <!-- <xsl:if test="$namespace = 'bipm'"> - <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']"> - <word><xsl:value-of select="normalize-space(.)"/></word> - </xsl:for-each> - </xsl:if> --> - </xsl:variable> <xsl:variable name="words"> <xsl:variable name="string_with_added_zerospaces"> <xsl:call-template name="add-zero-spaces-java"> <xsl:with-param name="text" select="$td_text"/> @@ -2103,11 +2383,10 @@ </xsl:for-each> </xsl:otherwise> </xsl:choose> </xsl:variable> - <column> <xsl:for-each select="xalan:nodeset($widths)//width"> <xsl:sort select="." data-type="number" order="descending"/> <xsl:if test="position()=1"> @@ -2139,11 +2418,10 @@ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/> <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces --> </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> @@ -2151,17 +2429,16 @@ <xsl:param name="cols-count"/> <!-- row for title --> <fo:table-row> <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:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']"> <xsl:with-param name="continued">true</xsl:with-param> </xsl:apply-templates> - </fo:table-cell> </fo:table-row> </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody"> <fo:table-body> <xsl:apply-templates/> @@ -2173,68 +2450,10 @@ <xsl:if test="../*[local-name()='tfoot']"> <fo:table-footer> <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> </fo:table-footer> </xsl:if> - </xsl:template><xsl:template name="insertTableFooter2"> - <xsl:param name="cols-count"/> - <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/> - <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'"> - - <fo:table-footer> - - <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> - - <!-- if there are note(s) or fn(s) then create footer row --> - <xsl:if test="$isNoteOrFnExist = 'true'"> - - - - <fo:table-row> - <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}"> - - - - <!-- fn will be processed inside 'note' processing --> - - - - - - - <!-- except gb --> - - <xsl:apply-templates select="../*[local-name()='note']" mode="process"/> - - - <!-- show Note under table in preface (ex. abstract) sections --> - <!-- empty, because notes show at page side in main sections --> - <!-- <xsl:if test="$namespace = 'bipm'"> - <xsl:choose> - <xsl:when test="ancestor::*[local-name()='preface']"> - <xsl:apply-templates select="../*[local-name()='note']" mode="process"/> - </xsl:when> - <xsl:otherwise> - <fo:block/> - </xsl:otherwise> - </xsl:choose> - </xsl:if> --> - - - <!-- horizontal row separator --> - - - <!-- fn processing --> - <xsl:call-template name="fn_display"/> - - </fo:table-cell> - </fo:table-row> - - </xsl:if> - </fo:table-footer> - - </xsl:if> </xsl:template><xsl:template name="insertTableFooterInSeparateTable"> <xsl:param name="table_attributes"/> <xsl:param name="colwidths"/> <xsl:param name="colgroup"/> @@ -2256,21 +2475,22 @@ </xsl:otherwise> </xsl:choose> </xsl:variable> <fo:table keep-with-previous="always"> - <xsl:for-each select="xalan:nodeset($table_attributes)/attribute"> + <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*"> + <xsl:variable name="name" select="local-name()"/> <xsl:choose> - <xsl:when test="@name = 'border-top'"> - <xsl:attribute name="{@name}">0pt solid black</xsl:attribute> + <xsl:when test="$name = 'border-top'"> + <xsl:attribute name="{$name}">0pt solid black</xsl:attribute> </xsl:when> - <xsl:when test="@name = 'border'"> - <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute> + <xsl:when test="$name = 'border'"> + <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute> <xsl:attribute name="border-top">0pt solid black</xsl:attribute> </xsl:when> <xsl:otherwise> - <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute> + <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:for-each> @@ -2295,54 +2515,38 @@ </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}"> + <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}"> + <!-- fn will be processed inside 'note' processing --> - - - <!-- for BSI (not PAS) display Notes before footnotes --> - <!-- except gb --> + <!-- except gb and bsi --> - <xsl:apply-templates select="../*[local-name()='note']" mode="process"/> + <xsl:apply-templates select="../*[local-name()='note']" mode="process"/> + - <!-- <xsl:if test="$namespace = 'bipm'"> - <xsl:choose> - <xsl:when test="ancestor::*[local-name()='preface']"> - show Note under table in preface (ex. abstract) sections - <xsl:apply-templates select="../*[local-name()='note']" mode="process"/> - </xsl:when> - <xsl:otherwise> - empty, because notes show at page side in main sections - <fo:block/> - </xsl:otherwise> - </xsl:choose> - </xsl:if> --> - - <!-- horizontal row separator --> <!-- fn processing --> - <xsl:call-template name="fn_display"/> + <xsl:call-template name="table_fn_display"/> - <!-- for PAS display Notes after footnotes --> </fo:table-cell> </fo:table-row> @@ -2379,119 +2583,92 @@ <fo:table-body> <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'"> - <xsl:attribute name="font-weight">bold</xsl:attribute> - - - - - - - - - </xsl:if> - <xsl:if test="$parent-name = 'tfoot'"> - - - - </xsl:if> - - - <xsl:if test="not(*[local-name()='th'])"> - <xsl:attribute name="min-height">8mm</xsl:attribute> - </xsl:if> - - - - - - - - - - <!-- <xsl:if test="$namespace = 'bipm'"> - <xsl:attribute name="height">8mm</xsl:attribute> - </xsl:if> --> - - <xsl:apply-templates/> - </fo:table-row> - </xsl:template><xsl:template match="*[local-name()='th']"> - <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center"> - <xsl:attribute name="text-align"> - <xsl:choose> - <xsl:when test="@align"> - <xsl:call-template name="setAlignment"/> - <!-- <xsl:value-of select="@align"/> --> - </xsl:when> - <xsl:otherwise>center</xsl:otherwise> - </xsl:choose> - </xsl:attribute> + </xsl:template><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="setTableRowAttributes"/> + <xsl:apply-templates/> + </fo:table-row> + </xsl:template><xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2"> + <fo:table-row xsl:use-attribute-sets="table-footer-row-style"> + <xsl:call-template name="setTableRowAttributes"/> + <xsl:apply-templates/> + </fo:table-row> + </xsl:template><xsl:template match="*[local-name()='tr']"> + <fo:table-row xsl:use-attribute-sets="table-body-row-style"> + + + + <xsl:call-template name="setTableRowAttributes"/> + <xsl:apply-templates/> + </fo:table-row> + </xsl:template><xsl:template name="setTableRowAttributes"> + + + + + + + + + <xsl:if test="not(*[local-name()='th'])"> + <xsl:attribute name="min-height">8mm</xsl:attribute> + </xsl:if> + + </xsl:template><xsl:template match="*[local-name()='th']"> + <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:attribute name="display-align">center</xsl:attribute> - <xsl:attribute name="font-style">italic</xsl:attribute> - <xsl:attribute name="font-weight">normal</xsl:attribute> - <xsl:attribute name="padding-top">2mm</xsl:attribute> - <xsl:attribute name="padding-left">2mm</xsl:attribute> - <xsl:attribute name="border">solid black 0pt</xsl:attribute> - <xsl:attribute name="border-top">solid black 0.2pt</xsl:attribute> - <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute> - <xsl:attribute name="text-indent">0mm</xsl:attribute> + + + + + <xsl:if test="$lang = 'ar'"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> - <xsl:if test="@colspan"> - <xsl:attribute name="number-columns-spanned"> - <xsl:value-of select="@colspan"/> - </xsl:attribute> - </xsl:if> - <xsl:if test="@rowspan"> - <xsl:attribute name="number-rows-spanned"> - <xsl:value-of select="@rowspan"/> - </xsl:attribute> - </xsl:if> - <xsl:call-template name="display-align"/> + + <xsl:call-template name="setTableCellAttributes"/> + <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> + </xsl:template><xsl:template name="setTableCellAttributes"> + <xsl:if test="@colspan"> + <xsl:attribute name="number-columns-spanned"> + <xsl:value-of select="@colspan"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@rowspan"> + <xsl:attribute name="number-rows-spanned"> + <xsl:value-of select="@rowspan"/> + </xsl:attribute> + </xsl:if> + <xsl:call-template name="display-align"/> </xsl:template><xsl:template name="display-align"> <xsl:if test="@valign"> <xsl:attribute name="display-align"> <xsl:choose> <xsl:when test="@valign = 'top'">before</xsl:when> @@ -2500,104 +2677,79 @@ <xsl:otherwise>before</xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:if> </xsl:template><xsl:template match="*[local-name()='td']"> - <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm"> - <xsl:attribute name="text-align"> - <xsl:choose> - <xsl:when test="@align"> - <xsl:call-template name="setAlignment"/> - <!-- <xsl:value-of select="@align"/> --> - </xsl:when> - <xsl:otherwise>left</xsl:otherwise> - </xsl:choose> - </xsl:attribute> + <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" --> + <xsl:call-template name="setTextAlignment"> + <xsl:with-param name="default">left</xsl:with-param> + </xsl:call-template> + <xsl:if test="$lang = 'ar'"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> + <!-- bsi --> - <xsl:attribute name="display-align">before</xsl:attribute> - <xsl:attribute name="padding-left">0mm</xsl:attribute> - <xsl:attribute name="padding-top">2mm</xsl:attribute> - <xsl:attribute name="padding-bottom">1mm</xsl:attribute> - <xsl:attribute name="border">solid black 0pt</xsl:attribute> - <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute> - <xsl:attribute name="text-indent">0mm</xsl:attribute> + - <xsl:if test=".//*[local-name() = 'table']"> + <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table --> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> - <xsl:if test="@colspan"> - <xsl:attribute name="number-columns-spanned"> - <xsl:value-of select="@colspan"/> - </xsl:attribute> - </xsl:if> - <xsl:if test="@rowspan"> - <xsl:attribute name="number-rows-spanned"> - <xsl:value-of select="@rowspan"/> - </xsl:attribute> - </xsl:if> - <xsl:call-template name="display-align"/> + + <xsl:call-template name="setTableCellAttributes"/> + <fo:block> - + + + <xsl:apply-templates/> </fo:block> </fo:table-cell> </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process"> + + <fo:block xsl:use-attribute-sets="table-note-style"> + + + + - - <fo:block font-size="10pt" margin-bottom="12pt"> + <!-- Table's note name (NOTE, for example) --> + <fo:inline xsl:use-attribute-sets="table-note-name-style"> + <xsl:if test="@type = 'source' or @type = 'abbreviation'"> + <xsl:attribute name="font-size">9pt</xsl:attribute> + </xsl:if> - <!-- Table's note name (NOTE, for example) --> - - <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style"> + <xsl:apply-templates select="*[local-name() = 'name']"/> - - - <xsl:if test="@type = 'source' or @type = 'abbreviation'"> - <xsl:attribute name="font-size">9pt</xsl:attribute> - <!-- <fo:inline> - <xsl:call-template name="capitalize"> - <xsl:with-param name="str" select="@type"/> - </xsl:call-template> - <xsl:text>: </xsl:text> - </fo:inline> --> - </xsl:if> - - - - <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> - - </fo:inline> - - - - <xsl:apply-templates mode="process"/> - </fo:block> + </fo:inline> + + + + <xsl:apply-templates select="node()[not(local-name() = 'name')]" mode="process"/> + </fo:block> </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 match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn"> @@ -2673,15 +2825,12 @@ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'"> <fo:footnote xsl:use-attribute-sets="fn-style"> <xsl:copy-of select="$footnote_inline"/> <fo:footnote-body> - <fo:block-container text-indent="0" start-indent="0"> + <fo:block-container xsl:use-attribute-sets="fn-container-body-style"> - - <xsl:attribute name="margin-left">-8mm</xsl:attribute> - <fo:block xsl:use-attribute-sets="fn-body-style"> <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style"> @@ -2695,48 +2844,41 @@ </xsl:when> <xsl:otherwise> <xsl:copy-of select="$footnote_inline"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="fn_display"> + </xsl:template><xsl:template name="table_fn_display"> <xsl:variable name="references"> <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']"> <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"> + <fo:block xsl:use-attribute-sets="table-fn-style"> - - - - - <fo:inline font-size="80%" padding-right="5mm" id="{@id}"> + <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style"> - <xsl:attribute name="vertical-align">super</xsl:attribute> + <xsl:value-of select="@reference"/> - <xsl:value-of select="@reference"/> </fo:inline> - <fo:inline> - - <!-- <xsl:apply-templates /> --> + <fo:inline xsl:use-attribute-sets="table-fn-body-style"> <xsl:copy-of select="./node()"/> </fo:inline> </fo:block> </xsl:if> </xsl:for-each> @@ -2744,81 +2886,73 @@ <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 /> - </fn> - </xsl:for-each> - </xsl:variable> - $references=<xsl:copy-of select="$references"/> --> + </xsl:template><xsl:template name="table_name_fn_display"> <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']"> <xsl:variable name="reference" select="@reference"/> <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block> <fo:block margin-bottom="12pt"> <xsl:apply-templates/> </fo:block> </xsl:for-each> </xsl:template><xsl:template name="fn_display_figure"> - <xsl:variable name="key_iso"> - <!-- and (not(@class) or @class !='pseudocode') --> - </xsl:variable> + <xsl:variable name="references"> <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]"> <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> <xsl:apply-templates/> </fn> </xsl:for-each> </xsl:variable> + + <xsl:if test="xalan:nodeset($references)//fn"> - <!-- current hierarchy is 'figure' element --> - <xsl:variable name="following_dl_colwidths"> - <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' --> - <xsl:variable name="html-table"> - <xsl:variable name="doc_ns"> + <xsl:variable name="key_iso"> + + </xsl:variable> + + <!-- current hierarchy is 'figure' element --> + <xsl:variable name="following_dl_colwidths"> + <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' --> + <xsl:variable name="html-table"> + <xsl:variable name="doc_ns"> + + </xsl:variable> + <xsl:variable name="ns"> + <xsl:choose> + <xsl:when test="normalize-space($doc_ns) != ''"> + <xsl:value-of select="normalize-space($doc_ns)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring-before(name(/*), '-')"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> - </xsl:variable> - <xsl:variable name="ns"> - <xsl:choose> - <xsl:when test="normalize-space($doc_ns) != ''"> - <xsl:value-of select="normalize-space($doc_ns)"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="substring-before(name(/*), '-')"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> --> - <!-- <xsl:element name="{$ns}:table"> --> <xsl:for-each select="*[local-name() = 'dl'][1]"> <tbody> <xsl:apply-templates mode="dl"/> </tbody> </xsl:for-each> - <!-- </xsl:element> --> - </xsl:variable> - - <xsl:call-template name="calculate-column-widths"> - <xsl:with-param name="cols-count" select="2"/> - <xsl:with-param name="table" select="$html-table"/> - </xsl:call-template> - - </xsl:if> - </xsl:variable> - - - <xsl:variable name="maxlength_dt"> - <xsl:for-each select="*[local-name() = 'dl'][1]"> - <xsl:call-template name="getMaxLength_dt"/> - </xsl:for-each> - </xsl:variable> - - <xsl:if test="xalan:nodeset($references)//fn"> + </xsl:variable> + + <xsl:call-template name="calculate-column-widths"> + <xsl:with-param name="cols-count" select="2"/> + <xsl:with-param name="table" select="$html-table"/> + </xsl:call-template> + + </xsl:if> + </xsl:variable> + + <xsl:variable name="maxlength_dt"> + <xsl:for-each select="*[local-name() = 'dl'][1]"> + <xsl:call-template name="getMaxLength_dt"/> + </xsl:for-each> + </xsl:variable> + <fo:block> <fo:table width="95%" table-layout="fixed"> <xsl:if test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="font-size">10pt</xsl:attribute> @@ -2841,24 +2975,22 @@ <xsl:variable name="reference" select="@reference"/> <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note--> <fo:table-row> <fo:table-cell> <fo:block> - <fo:inline font-size="80%" padding-right="5mm" vertical-align="super" id="{@id}"> - + <fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style"> <xsl:value-of select="@reference"/> </fo:inline> </fo:block> </fo:table-cell> <fo:table-cell> - <fo:block text-align="justify" margin-bottom="12pt"> - + <fo:block xsl:use-attribute-sets="figure-fn-body-style"> <xsl:if test="normalize-space($key_iso) = 'true'"> - <xsl:attribute name="margin-bottom">0</xsl:attribute> + + <xsl:attribute name="margin-bottom">0</xsl:attribute> + </xsl:if> - - <!-- <xsl:apply-templates /> --> <xsl:copy-of select="./node()"/> </fo:block> </fo:table-cell> </fo:table-row> </xsl:if> @@ -2867,22 +2999,16 @@ </fo:table> </fo:block> </xsl:if> </xsl:template><xsl:template match="*[local-name()='fn']"> - <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> --> - <fo:inline font-size="80%" keep-with-previous.within-line="always"> + <fo:inline xsl:use-attribute-sets="fn-reference-style"> + - - - - - - <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"/> @@ -2898,15 +3024,15 @@ </xsl:template><xsl:template match="*[local-name()='dl']"> <xsl:variable name="isAdded" select="@added"/> <xsl:variable name="isDeleted" select="@deleted"/> <fo:block-container> - <xsl:if test="not(ancestor::*[local-name() = 'quote'])"> - <xsl:attribute name="margin-left">0mm</xsl:attribute> - </xsl:if> + <xsl:if test="not(ancestor::*[local-name() = 'quote'])"> + <xsl:attribute name="margin-left">0mm</xsl:attribute> + </xsl:if> + - <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> @@ -2918,39 +3044,38 @@ <xsl:call-template name="setTrackChangesStyles"> <xsl:with-param name="isAdded" select="$isAdded"/> <xsl:with-param name="isDeleted" select="$isDeleted"/> </xsl:call-template> - <fo:block-container> + <fo:block-container margin-left="0mm"> + - <xsl:attribute name="margin-left">0mm</xsl:attribute> - <xsl:attribute name="margin-right">0mm</xsl:attribute> + <xsl:attribute name="margin-right">0mm</xsl:attribute> + - <xsl:variable name="parent" select="local-name(..)"/> <xsl:variable name="key_iso"> <!-- and (not(../@class) or ../@class !='pseudocode') --> </xsl:variable> <xsl:choose> <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component --> - - <fo:block margin-bottom="12pt" text-align="left"> - - <xsl:variable name="title-where"> - <xsl:call-template name="getLocalizedString"> - <xsl:with-param name="key">where</xsl:with-param> - </xsl:call-template> - </xsl:variable> - <xsl:value-of select="$title-where"/><xsl:text> </xsl:text> - <xsl:apply-templates select="*[local-name()='dt']/*"/> - <xsl:text/> - <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/> - </fo:block> - + <fo:block margin-bottom="12pt" text-align="left"> + + <xsl:variable name="title-where"> + <xsl:call-template name="getLocalizedString"> + <xsl:with-param name="key">where</xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-where"/><xsl:text> </xsl:text> + <xsl:apply-templates select="*[local-name()='dt']/*"/> + <xsl:text/> + <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/> + </fo:block> + </xsl:when> <xsl:when test="$parent = 'formula'"> <!-- a few components --> <fo:block margin-bottom="12pt" text-align="left"> @@ -2993,13 +3118,11 @@ <fo:table width="95%" table-layout="fixed"> <xsl:choose> - <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"> - <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> --> - </xsl:when> + <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/> <xsl:when test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="font-size">10pt</xsl:attribute> </xsl:when> </xsl:choose> @@ -3016,16 +3139,13 @@ <xsl:otherwise> <xsl:value-of select="substring-before(name(/*), '-')"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> --> - <!-- <xsl:element name="{$ns}:table"> --> - <tbody> - <xsl:apply-templates mode="dl"/> - </tbody> - <!-- </xsl:element> --> + <tbody> + <xsl:apply-templates mode="dl"/> + </tbody> </xsl:variable> <!-- html-table<xsl:copy-of select="$html-table"/> --> <xsl:variable name="colwidths"> <xsl:call-template name="calculate-column-widths"> <xsl:with-param name="cols-count" select="2"/> @@ -3101,12 +3221,10 @@ </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:otherwise> </xsl:choose> - <!-- <fo:table-column column-width="15%"/> - <fo:table-column column-width="85%"/> --> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template name="getMaxLength_dt"> <xsl:variable name="lengths"> <xsl:for-each select="*[local-name()='dt']"> @@ -3117,16 +3235,10 @@ </xsl:variable> <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length> </xsl:for-each> </xsl:variable> <xsl:variable name="maxLength"> - <!-- <xsl:for-each select="*[local-name()='dt']"> - <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/> - <xsl:if test="position() = 1"> - <xsl:value-of select="string-length(normalize-space(.))"/> - </xsl:if> - </xsl:for-each> --> <xsl:for-each select="xalan:nodeset($lengths)/length"> <xsl:sort select="." data-type="number" order="descending"/> <xsl:if test="position() = 1"> <xsl:value-of select="."/> </xsl:if> @@ -3148,96 +3260,57 @@ <fo:table-cell> <fo:block margin-top="6pt"> <xsl:if test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="margin-top">0</xsl:attribute> </xsl:if> - <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> + <xsl:apply-templates select="*[local-name() = 'name']"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> - <xsl:apply-templates/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> </fo:table-cell> </fo:table-row> </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl"> <tr> <td> <xsl:apply-templates/> </td> <td> - - <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> - + <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> + </td> </tr> </xsl:template><xsl:template match="*[local-name()='dt']"> <xsl:param name="key_iso"/> - <fo:table-row> - - + <fo:table-row xsl:use-attribute-sets="dt-row-style"> <fo:table-cell> - <fo:block margin-top="6pt"> + <fo:block xsl:use-attribute-sets="dt-style"> <xsl:copy-of select="@id"/> - <xsl:if test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="margin-top">0</xsl:attribute> - </xsl:if> - - - - <xsl:apply-templates/> - <!-- <xsl:if test="$namespace = 'gb'"> - <xsl:if test="ancestor::*[local-name()='formula']"> - <xsl:text>—</xsl:text> - </xsl:if> - </xsl:if> --> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> - <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'"> - <xsl:if test="local-name(*[1]) != 'stem'"> - <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> - </xsl:if> - </xsl:if> --> - - <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> - + + <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> </fo:block> </fo:table-cell> </fo:table-row> - <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'"> - <xsl:if test="local-name(*[1]) = 'stem'"> - <fo:table-row> - <fo:table-cell> - <fo:block margin-top="6pt"> - <xsl:if test="normalize-space($key_iso) = 'true'"> - <xsl:attribute name="margin-top">0</xsl:attribute> - </xsl:if> - <xsl:text>&#xA0;</xsl:text> - </fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block> - <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> - </fo:block> - </fo:table-cell> - </fo:table-row> - </xsl:if> - </xsl:if> --> </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process"> <xsl:apply-templates/> </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process"> <xsl:apply-templates select="@language"/> <xsl:apply-templates/> @@ -3262,10 +3335,11 @@ <fo:inline font-size="80%" vertical-align="sub"> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name()='tt']"> <fo:inline xsl:use-attribute-sets="tt-style"> + <xsl:variable name="_font-size"> @@ -3298,19 +3372,25 @@ </xsl:template><xsl:template match="*[local-name()='underline']"> <fo:inline text-decoration="underline"> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name()='add']"> + <xsl:param name="skip">true</xsl:param> <xsl:choose> <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start --> - <fo:inline> - <xsl:call-template name="insertTag"> - <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --> - <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C --> - <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C --> - </xsl:call-template> - </fo:inline> + <xsl:choose> + <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab'])) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when> + <xsl:otherwise> + <fo:inline> + <xsl:call-template name="insertTag"> + <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --> + <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C --> + <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C --> + </xsl:call-template> + </fo:inline> + </xsl:otherwise> + </xsl:choose> </xsl:when> <xsl:when test="@amendment"> <fo:inline> <xsl:call-template name="insertTag"> <xsl:with-param name="kind">A</xsl:with-param> @@ -3349,12 +3429,10 @@ <xsl:param name="kind"/> <xsl:param name="value"/> <xsl:variable name="add_width" select="string-length($value) * 20"/> <xsl:variable name="maxwidth" select="60 + $add_width"/> <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" --> - <!-- <xsl:attribute name="width">7mm</xsl:attribute> - <xsl:attribute name="content-height">100%</xsl:attribute> --> <xsl:attribute name="height">5mm</xsl:attribute> <xsl:attribute name="content-width">100%</xsl:attribute> <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute> <xsl:attribute name="scaling">uniform</xsl:attribute> <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80"> @@ -3568,18 +3646,10 @@ <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/> </xsl:variable> <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/> - <!-- <xsl:choose> - <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] "> - - </xsl:when> - <xsl:otherwise> - <xsl:copy-of select="current()"/> - </xsl:otherwise> - </xsl:choose> --> </xsl:variable> <xsl:copy-of select="$simple-table"/> </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan"> <xsl:apply-templates mode="simple-table-colspan"/> </xsl:template><xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan"> @@ -3694,23 +3764,19 @@ <xsl:param name="str"/> <xsl:variable name="str2" select="translate($str, '-', ' ')"/> <xsl:choose> <xsl:when test="contains($str2, ' ')"> <xsl:variable name="substr" select="substring-before($str2, ' ')"/> - <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/> - <xsl:value-of select="substring($substr, 2)"/> --> <xsl:call-template name="capitalize"> <xsl:with-param name="str" select="$substr"/> </xsl:call-template> <xsl:text> </xsl:text> <xsl:call-template name="capitalizeWords"> <xsl:with-param name="str" select="substring-after($str2, ' ')"/> </xsl:call-template> </xsl:when> <xsl:otherwise> - <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/> - <xsl:value-of select="substring($str2, 2)"/> --> <xsl:call-template name="capitalize"> <xsl:with-param name="str" select="$str2"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> @@ -3734,10 +3800,11 @@ <xsl:variable name="mathml"> <xsl:apply-templates select="." mode="mathml"/> </xsl:variable> <fo:instream-foreign-object fox:alt-text="Math"> + <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/> <xsl:variable name="comment_text_"> <xsl:choose> @@ -3765,11 +3832,11 @@ <xsl:attribute name="fox:actual-text"> <xsl:value-of select="$mathml_content"/> </xsl:attribute> - <!-- <xsl:copy-of select="."/> --> + <xsl:copy-of select="xalan:nodeset($mathml)"/> </fo:instream-foreign-object> </fo:inline> </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text"> <!-- <xsl:text>a+b</xsl:text> --> @@ -3824,10 +3891,14 @@ </xsl:variable> <fo:inline xsl:use-attribute-sets="link-style"> + + + + <xsl:choose> <xsl:when test="$target_text = ''"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> @@ -3881,11 +3952,10 @@ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name() = 'xref']"> <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style"> - <xsl:apply-templates/> </fo:basic-link> </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula"> <fo:block-container margin-left="0mm"> <xsl:if test="parent::*[local-name() = 'note']"> @@ -3909,62 +3979,77 @@ </fo:inline> </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']"> <fo:inline> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="formula_number"> <!-- show by demand --> <xsl:if test="normalize-space() != ''"> <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'note']" name="note"> <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style"> + + + + + + <fo:block-container margin-left="0mm"> + + - - - - - <fo:block> + <fo:block> + + - - <xsl:attribute name="font-size">10pt</xsl:attribute> - <xsl:attribute name="text-indent">0</xsl:attribute> - <xsl:attribute name="padding-top">1.5mm</xsl:attribute> - <xsl:if test="../@type = 'source' or ../@type = 'abbreviation'"> - <xsl:attribute name="font-size">9pt</xsl:attribute> - <xsl:attribute name="text-align">justify</xsl:attribute> - <xsl:attribute name="padding-top">0mm</xsl:attribute> - </xsl:if> - - - - - - <fo:inline xsl:use-attribute-sets="note-name-style"> - <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> - </fo:inline> - <xsl:apply-templates/> - </fo:block> - - + + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="text-indent">0</xsl:attribute> + <xsl:attribute name="padding-top">1.5mm</xsl:attribute> + <xsl:if test="../@type = 'source' or ../@type = 'abbreviation'"> + <xsl:attribute name="font-size">9pt</xsl:attribute> + <xsl:attribute name="text-align">justify</xsl:attribute> + <xsl:attribute name="padding-top">0mm</xsl:attribute> + </xsl:if> + + + <fo:inline xsl:use-attribute-sets="note-name-style"> + + + + <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name--> + <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"> + <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]"> + <xsl:with-param name="skip">false</xsl:with-param> + </xsl:apply-templates> + </xsl:if> + + <xsl:apply-templates select="*[local-name() = 'name']"/> + + </fo:inline> + + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> + </fo:block> + </fo:block-container> </fo:block-container> </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']"> <xsl:variable name="num"><xsl:number/></xsl:variable> <xsl:choose> - <xsl:when test="$num = 1"> + <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE --> <fo:inline xsl:use-attribute-sets="note-p-style"> <xsl:apply-templates/> </fo:inline> </xsl:when> <xsl:otherwise> @@ -3975,16 +4060,20 @@ </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"/> + + <xsl:apply-templates select="*[local-name() = 'name']"/> + </fo:inline> - <xsl:apply-templates/> + + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']"> <xsl:param name="sfx"/> <xsl:variable name="suffix"> <xsl:choose> <xsl:when test="$sfx != ''"> <xsl:value-of select="$sfx"/> @@ -3999,11 +4088,11 @@ </xsl:variable> <xsl:if test="normalize-space() != ''"> <xsl:apply-templates/> <xsl:value-of select="$suffix"/> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']"> <xsl:param name="sfx"/> <xsl:variable name="suffix"> <xsl:choose> <xsl:when test="$sfx != ''"> <xsl:value-of select="$sfx"/> @@ -4026,29 +4115,27 @@ <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> --> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'term']"> - <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> --> <fo:block id="{@id}" xsl:use-attribute-sets="term-style"> + + <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])"> </xsl:if> - <xsl:apply-templates/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <xsl:variable name="level"> <xsl:call-template name="getLevelTermName"/> </xsl:variable> <fo:inline role="H{$level}"> <xsl:apply-templates/> - <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'"> - <xsl:text>.</xsl:text> - </xsl:if> --> </fo:inline> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure"> <xsl:variable name="isAdded" select="@added"/> <xsl:variable name="isDeleted" select="@deleted"/> @@ -4057,28 +4144,30 @@ <xsl:call-template name="setTrackChangesStyles"> <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:use-attribute-sets="figure-style"> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> <xsl:call-template name="fn_display_figure"/> <xsl:for-each select="*[local-name() = 'note']"> <xsl:call-template name="note"/> </xsl:for-each> - <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> + <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image --> + </fo:block-container> </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']"> <fo:block id="{@id}"> - <xsl:apply-templates/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> + <xsl:apply-templates select="*[local-name() = 'name']"/> </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']"> <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style"> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'image']"> @@ -4181,13 +4270,11 @@ <xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/> <xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/> <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/> <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/> <xsl:variable name="width" select="java:getWidth($bufferedImage)"/> - <!-- width=<xsl:value-of select="$width"/> --> <xsl:variable name="height" select="java:getHeight($bufferedImage)"/> - <!-- height=<xsl:value-of select="$height"/> --> <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1"> <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/> <xsl:call-template name="svg_cross"> <xsl:with-param name="width" select="$width"/> <xsl:with-param name="height" select="$height"/> @@ -4453,11 +4540,11 @@ <fo:block> </fo:block></fo:block-container> </fo:inline-container> </fo:basic-link> </fo:block> </fo:block-container> - </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents"> + </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents"> <xsl:apply-templates mode="contents"/> <xsl:text> </xsl:text> </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks"> <xsl:apply-templates mode="bookmarks"/> <xsl:text> </xsl:text> @@ -4606,12 +4693,10 @@ - - </fo:bookmark-tree> </xsl:if> </xsl:template><xsl:template name="insertFigureBookmarks"> <xsl:param name="contents"/> <xsl:if test="xalan:nodeset($contents)/figure"> @@ -4678,11 +4763,11 @@ </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="bookmark"/> </xsl:otherwise> </xsl:choose> - </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: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']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="figure-name-style"> <xsl:apply-templates/> @@ -4694,16 +4779,10 @@ <xsl:with-param name="mode" select="$mode"/> </xsl:apply-templates> <!-- <xsl:text> </xsl:text> --> </xsl:template><xsl:template name="getSection"> <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/> - <!-- - <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"> - <xsl:value-of select="."/> - </xsl:for-each> - --> - </xsl:template><xsl:template name="getName"> <xsl:choose> <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']"> <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/> </xsl:when> @@ -4768,20 +4847,25 @@ </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item"> <xsl:param name="mode">bookmarks</xsl:param> <xsl:apply-templates mode="contents_item"> <xsl:with-param name="mode" select="$mode"/> </xsl:apply-templates> - </xsl:template><xsl:template match="*[local-name() = 'add'][starts-with(text(), $ace_tag)]" mode="contents_item"> + </xsl:template><xsl:template match="*[local-name() = 'add']" mode="contents_item"> <xsl:param name="mode">bookmarks</xsl:param> - <xsl:if test="$mode = 'contents'"> - <xsl:copy> - <xsl:apply-templates mode="contents_item"/> - </xsl:copy> - </xsl:if> + <xsl:choose> + <xsl:when test="starts-with(text(), $ace_tag)"> + <xsl:if test="$mode = 'contents'"> + <xsl:copy> + <xsl:apply-templates mode="contents_item"/> + </xsl:copy> + </xsl:if> + </xsl:when> + <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise> + </xsl:choose> </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode"> - <fo:block-container margin-left="0mm"> + <fo:block-container xsl:use-attribute-sets="sourcecode-container-style"> <xsl:copy-of select="@id"/> <xsl:if test="parent::*[local-name() = 'note']"> <xsl:attribute name="margin-left"> <xsl:choose> @@ -4814,10 +4898,11 @@ 10 </xsl:variable> + <xsl:variable name="font-size" select="normalize-space($_font-size)"/> <xsl:if test="$font-size != ''"> <xsl:attribute name="font-size"> <xsl:choose> <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when> @@ -4830,15 +4915,15 @@ - <xsl:apply-templates/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content --> </fo:block-container> @@ -4848,22 +4933,22 @@ <xsl:call-template name="add-zero-spaces-equal"/> </xsl:variable> <xsl:call-template name="add-zero-spaces-java"> <xsl:with-param name="text" select="$text"/> </xsl:call-template> - </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="sourcecode-name-style"> <xsl:apply-templates/> </fo:block> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'permission']"> <fo:block id="{@id}" xsl:use-attribute-sets="permission-style"> - <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> - <xsl:apply-templates/> + <xsl:apply-templates select="*[local-name()='name']"/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="permission-name-style"> <xsl:apply-templates/> </fo:block> @@ -4872,52 +4957,52 @@ <fo:block xsl:use-attribute-sets="permission-label-style"> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'requirement']"> <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style"> - <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> - <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/> - <xsl:apply-templates select="@obligation" mode="presentation"/> - <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/> - <xsl:apply-templates/> + <xsl:apply-templates select="*[local-name()='name']"/> + <xsl:apply-templates select="*[local-name()='label']"/> + <xsl:apply-templates select="@obligation"/> + <xsl:apply-templates select="*[local-name()='subject']"/> + <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'label') and not(local-name() = 'subject')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="requirement-name-style"> <xsl:apply-templates/> </fo:block> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"> <fo:block xsl:use-attribute-sets="requirement-label-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation"> <fo:block> <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/> </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"> + <fo:block xsl:use-attribute-sets="subject-style"> + <xsl:text>Target Type </xsl:text><xsl:apply-templates/> + </fo:block> </xsl:template><xsl:template match="*[local-name() = 'recommendation']"> <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style"> - <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> - <xsl:apply-templates/> + <xsl:apply-templates select="*[local-name()='name']"/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="recommendation-name-style"> <xsl:apply-templates/> </fo:block> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']"> <fo:block xsl:use-attribute-sets="recommendation-label-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation"> - <fo:block xsl:use-attribute-sets="subject-style"> - <xsl:text>Target Type </xsl:text><xsl:apply-templates/> - </fo:block> </xsl:template><xsl:template match="*[local-name() = 'subject']"> <fo:block xsl:use-attribute-sets="subject-style"> <xsl:text>Target Type </xsl:text><xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']"> @@ -4957,22 +5042,20 @@ <xsl:variable name="simple-table"> <xsl:call-template name="getSimpleTable"/> </xsl:variable> <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/> <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])"> - <!-- <fo:table-column column-width="35mm"/> - <fo:table-column column-width="115mm"/> --> <fo:table-column column-width="30%"/> <fo:table-column column-width="70%"/> </xsl:if> <xsl:apply-templates mode="requirement"/> </fo:table> <!-- fn processing --> <xsl:if test=".//*[local-name() = 'fn']"> <xsl:for-each select="*[local-name() = 'tbody']"> <fo:block font-size="90%" border-bottom="1pt solid black"> - <xsl:call-template name="fn_display"/> + <xsl:call-template name="table_fn_display"/> </fo:block> </xsl:for-each> </xsl:if> </fo:block-container> </fo:block-container> @@ -4985,11 +5068,10 @@ <xsl:apply-templates mode="requirement"/> </fo:table-body> </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement"> <fo:table-row height="7mm" border-bottom="0.5pt solid grey"> <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) --> - <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> --> <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute> </xsl:if> <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')"> <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute> </xsl:if> @@ -4998,38 +5080,15 @@ </xsl:if> <xsl:apply-templates mode="requirement"/> </fo:table-row> </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement"> <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" --> - <xsl:attribute name="text-align"> - <xsl:choose> - <xsl:when test="@align"> - <xsl:value-of select="@align"/> - </xsl:when> - <xsl:otherwise>left</xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:if test="@colspan"> - <xsl:attribute name="number-columns-spanned"> - <xsl:value-of select="@colspan"/> - </xsl:attribute> - </xsl:if> - <xsl:if test="@rowspan"> - <xsl:attribute name="number-rows-spanned"> - <xsl:value-of select="@rowspan"/> - </xsl:attribute> - </xsl:if> - <xsl:call-template name="display-align"/> + <xsl:call-template name="setTextAlignment"> + <xsl:with-param name="default">left</xsl:with-param> + </xsl:call-template> - <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'"> - <xsl:attribute name="padding-top">0.5mm</xsl:attribute> - <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute> - </xsl:if> - <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'"> - <xsl:attribute name="padding-top">0.5mm</xsl:attribute> - <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute> - </xsl:if> --> + <xsl:call-template name="setTableCellAttributes"/> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> @@ -5037,41 +5096,19 @@ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" --> <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> <xsl:attribute name="padding">0mm</xsl:attribute> <xsl:attribute name="padding-left">0mm</xsl:attribute> </xsl:if> - <xsl:attribute name="text-align"> - <xsl:choose> - <xsl:when test="@align"> - <xsl:value-of select="@align"/> - </xsl:when> - <xsl:otherwise>left</xsl:otherwise> - </xsl:choose> - </xsl:attribute> + <xsl:call-template name="setTextAlignment"> + <xsl:with-param name="default">left</xsl:with-param> + </xsl:call-template> + <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])"> <xsl:attribute name="font-weight">bold</xsl:attribute> </xsl:if> - <xsl:if test="@colspan"> - <xsl:attribute name="number-columns-spanned"> - <xsl:value-of select="@colspan"/> - </xsl:attribute> - </xsl:if> - <xsl:if test="@rowspan"> - <xsl:attribute name="number-rows-spanned"> - <xsl:value-of select="@rowspan"/> - </xsl:attribute> - </xsl:if> - <xsl:call-template name="display-align"/> - <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'"> - <xsl:attribute name="padding-left">0.5mm</xsl:attribute> - <xsl:attribute name="padding-top">0.5mm</xsl:attribute> - <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> - <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute> - </xsl:if> - </xsl:if> --> - <!-- 2nd line and below --> + <xsl:call-template name="setTableCellAttributes"/> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> @@ -5079,19 +5116,19 @@ <fo:block font-size="11pt"> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]"> - <fo:block> <!-- margin-bottom="10pt" --> + <fo:block> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'termexample']"> <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style"> - <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> - <xsl:apply-templates/> + <xsl:apply-templates select="*[local-name()='name']"/> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation"> + </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:inline xsl:use-attribute-sets="termexample-name-style"> <xsl:apply-templates/> </fo:inline> </xsl:if> @@ -5113,13 +5150,11 @@ <fo:block id="{@id}" xsl:use-attribute-sets="example-style"> <xsl:variable name="fo_element"> <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if> - block - - + block </xsl:variable> <!-- display 'EXAMPLE' --> <xsl:apply-templates select="*[local-name()='name']"> <xsl:with-param name="fo_element" select="$fo_element"/> @@ -5192,10 +5227,12 @@ </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource"> <fo:block xsl:use-attribute-sets="termsource-style"> + + <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] --> <xsl:variable name="termsource_text"> <xsl:apply-templates/> </xsl:variable> <xsl:copy-of select="$termsource_text"/> @@ -5229,13 +5266,11 @@ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()"> <xsl:if test="normalize-space() != ''"> <xsl:value-of select="."/> </xsl:if> </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()"> - <fo:inline> - - + <fo:inline xsl:use-attribute-sets="termsource-text-style"> <xsl:value-of select="."/> </fo:inline> </xsl:template><xsl:template match="*[local-name() = 'origin']"> <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> <xsl:if test="normalize-space(@citeas) = ''"> @@ -5274,11 +5309,10 @@ <fo:block-container margin-left="0mm"> <fo:block xsl:use-attribute-sets="quote-style"> - <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> --> <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source --> </fo:block> <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']"> <fo:block xsl:use-attribute-sets="quote-source-style"> @@ -5317,20 +5351,18 @@ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:choose> - <xsl:when test="normalize-space($bibitemid) != ''"> + <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link --> <fo:inline xsl:use-attribute-sets="eref-style"> <xsl:if test="@type = 'footnote'"> + <xsl:attribute name="keep-together.within-line">always</xsl:attribute> + <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> + <xsl:attribute name="vertical-align">super</xsl:attribute> + <xsl:attribute name="font-size">80%</xsl:attribute> - <xsl:attribute name="keep-together.within-line">always</xsl:attribute> - <xsl:attribute name="font-size">80%</xsl:attribute> - <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> - <xsl:attribute name="vertical-align">super</xsl:attribute> - - </xsl:if> <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets --> <xsl:variable name="text" select="normalize-space()"/> @@ -5342,11 +5374,10 @@ </xsl:if> <xsl:if test="@type = 'inline'"> - <xsl:attribute name="text-decoration">underline</xsl:attribute> </xsl:if> @@ -5402,12 +5433,10 @@ <xsl:value-of select="normalize-space($padding)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> --> - <xsl:choose> <xsl:when test="$lang = 'zh'"> <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline> </xsl:when> <xsl:when test="../../@inline-header = 'true'"> @@ -5459,11 +5488,10 @@ </fo:block> </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]"> <xsl:apply-templates/> </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]"> <fo:inline> <xsl:apply-templates/></fo:inline> - <!-- <fo:block>&#xA0;</fo:block> --> <fo:block/> </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2"> <fo:block> <xsl:call-template name="setId"/> @@ -5503,15 +5531,10 @@ </fo:block> </xsl:template><xsl:template match="*[local-name() = 'definitions']"> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']"> - - <fo:block id="{@id}"> - <xsl:apply-templates/> - </fo:block> </xsl:template><xsl:template match="*[local-name() = 'annex']"> <fo:block break-after="page"/> <fo:block id="{@id}"> <xsl:variable name="num"><xsl:number/></xsl:variable> @@ -5777,36 +5800,72 @@ </fo:table-row> </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"> + </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/><xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2"> + <fo:block id="{@id}"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'references']"> + <xsl:if test="not(ancestor::*[local-name() = 'annex'])"> + + </xsl:if> + <!-- <xsl:if test="ancestor::*[local-name() = 'annex']"> + <xsl:if test="$namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'itu'"> + <fo:block break-after="page"/> + </xsl:if> + </xsl:if> --> + <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'bibitem']"> + <xsl:call-template name="bibitem"/> + </xsl:template><xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2"> - - - - + <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style"> + <xsl:call-template name="processBibitem"/> + </fo:block> + + </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2"> - - <!-- end MPFD bibitem processing --> + <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style"> + <xsl:call-template name="processBibitem"/> + </fo:block> + - <!-- start M3D bibitem processing --> + </xsl:template><xsl:template name="processBibitem"> - - + <fo:inline padding-right="5mm">[<xsl:value-of select="un:docidentifier"/>]</fo:inline><xsl:value-of select="un:docidentifier"/> + <xsl:if test="un:title"> + <fo:inline font-style="italic"> + <xsl:text>, </xsl:text> + <xsl:choose> + <xsl:when test="un:title[@type = 'main' and @language = 'en']"> + <xsl:apply-templates select="un:title[@type = 'main' and @language = 'en']"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="un:title"/> + </xsl:otherwise> + </xsl:choose> + </fo:inline> + </xsl:if> + <xsl:apply-templates select="un:formattedref"/> + + </xsl:template><xsl:template name="processBibitemDocId"> <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' 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"/> @@ -5859,10 +5918,54 @@ <xsl:value-of select="translate(.,'. ','')"/> </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip"> <xsl:value-of select="substring(.,1,1)"/> </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title"> <fo:inline><xsl:apply-templates/></fo:inline> + </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2"> + <!-- <fo:inline><xsl:apply-templates /></fo:inline> --> + <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM --> + <xsl:apply-templates/> + </fo:inline> + </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2"> + <fo:footnote> + <xsl:variable name="number"> + + <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/> + + </xsl:variable> + <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style"> + <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}"> + <xsl:value-of select="$number"/> + + </fo:basic-link> + </fo:inline> + <fo:footnote-body> + <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style"> + <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style"> + <xsl:value-of select="$number"/> + + </fo:inline> + <xsl:apply-templates/> + </fo:block> + </fo:footnote-body> + </fo:footnote> + </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho --> + <xsl:text> edition </xsl:text> + <xsl:value-of select="."/> + </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho --> + <xsl:text> (</xsl:text> + <fo:inline xsl:use-attribute-sets="link-style"> + <fo:basic-link external-destination="." fox:alt-text="."> + <xsl:value-of select="."/> + </fo:basic-link> + </fo:inline> + <xsl:text>)</xsl:text> + </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/><xsl:template match="*[local-name() = 'formattedref']"> + + <xsl:text>, </xsl:text> + + <xsl:apply-templates/> </xsl:template><xsl:template match="*[local-name() = 'form']"> <fo:block> <xsl:apply-templates/> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']"> @@ -5931,28 +6034,11 @@ <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: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 - </xsl:otherwise> </xsl:choose> </xsl:variable><xsl:template match="*[local-name() = 'toc']"> <xsl:param name="colwidths"/> <xsl:variable name="colwidths_"> @@ -6046,90 +6132,110 @@ </fo:inline> </xsl:template><xsl:template match="@language"> <xsl:copy-of select="."/> </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4"> <xsl:call-template name="title"/> + </xsl:template><xsl:template match="*[local-name() = 'admonition']"> + + + + <!-- display name before box --> + <fo:block xsl:use-attribute-sets="admonition-name-style"> + <xsl:call-template name="displayAdmonitionName"/> + </fo:block> + + + <!-- text in the box --> + <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style"> + + + + + + <fo:block-container xsl:use-attribute-sets="admonition-container-style"> + + + <fo:block-container margin-left="0mm" margin-right="0mm"> + <fo:block> + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> + </fo:block> + </fo:block-container> + + </fo:block-container> + + </fo:block-container> + + </xsl:template><xsl:template name="displayAdmonitionName"> + + <xsl:apply-templates select="*[local-name() = 'name']"/> + <xsl:if test="not(*[local-name() = 'name'])"> + <xsl:apply-templates select="@type"/> + </xsl:if> + + </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']"> + <xsl:apply-templates/> + </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type"> + <xsl:variable name="admonition_type_"> + <xsl:call-template name="getLocalizedString"> + <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/> + <xsl:value-of select="$admonition_type"/> + <xsl:if test="$admonition_type = ''"> + <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']"> + + <fo:block xsl:use-attribute-sets="admonition-p-style"> + + + + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template name="convertDate"> <xsl:param name="date"/> <xsl:param name="format" select="'short'"/> <xsl:variable name="year" select="substring($date, 1, 4)"/> <xsl:variable name="month" select="substring($date, 6, 2)"/> <xsl:variable name="day" select="substring($date, 9, 2)"/> <xsl:variable name="monthStr"> <xsl:choose> - <xsl:when test="$month = '01'">January</xsl:when> - <xsl:when test="$month = '02'">February</xsl:when> - <xsl:when test="$month = '03'">March</xsl:when> - <xsl:when test="$month = '04'">April</xsl:when> - <xsl:when test="$month = '05'">May</xsl:when> - <xsl:when test="$month = '06'">June</xsl:when> - <xsl:when test="$month = '07'">July</xsl:when> - <xsl:when test="$month = '08'">August</xsl:when> - <xsl:when test="$month = '09'">September</xsl:when> - <xsl:when test="$month = '10'">October</xsl:when> - <xsl:when test="$month = '11'">November</xsl:when> - <xsl:when test="$month = '12'">December</xsl:when> + <xsl:when test="$month = '01'">january</xsl:when> + <xsl:when test="$month = '02'">february</xsl:when> + <xsl:when test="$month = '03'">march</xsl:when> + <xsl:when test="$month = '04'">april</xsl:when> + <xsl:when test="$month = '05'">may</xsl:when> + <xsl:when test="$month = '06'">june</xsl:when> + <xsl:when test="$month = '07'">july</xsl:when> + <xsl:when test="$month = '08'">august</xsl:when> + <xsl:when test="$month = '09'">september</xsl:when> + <xsl:when test="$month = '10'">october</xsl:when> + <xsl:when test="$month = '11'">november</xsl:when> + <xsl:when test="$month = '12'">december</xsl:when> </xsl:choose> </xsl:variable> - <xsl:variable name="result"> - <xsl:choose> - <xsl:when test="$format = 'ddMMyyyy'"> - <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if> - <xsl:text> </xsl:text> - <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/> - </xsl:when> - <xsl:when test="$format = 'ddMM'"> - <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if> - <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/> - </xsl:when> - <xsl:when test="$format = 'short' or $day = ''"> - <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/> - </xsl:otherwise> - </xsl:choose> + <xsl:variable name="monthStr_localized"> + <xsl:if test="normalize-space($monthStr) != ''"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param></xsl:call-template></xsl:if> </xsl:variable> - <xsl:value-of select="$result"/> - </xsl:template><xsl:template name="convertDateLocalized"> - <xsl:param name="date"/> - <xsl:param name="format" select="'short'"/> - <xsl:variable name="year" select="substring($date, 1, 4)"/> - <xsl:variable name="month" select="substring($date, 6, 2)"/> - <xsl:variable name="day" select="substring($date, 9, 2)"/> - <xsl:variable name="monthStr"> - <xsl:choose> - <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when> - <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when> - </xsl:choose> - </xsl:variable> <xsl:variable name="result"> <xsl:choose> <xsl:when test="$format = 'ddMMyyyy'"> <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if> <xsl:text> </xsl:text> - <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/> + <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/> </xsl:when> <xsl:when test="$format = 'ddMM'"> <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if> - <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/> + <xsl:text> </xsl:text><xsl:value-of select="$monthStr_localized"/> </xsl:when> <xsl:when test="$format = 'short' or $day = ''"> - <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/> + <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/> + <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="$result"/> </xsl:template><xsl:template name="insertKeywords"> @@ -6178,17 +6284,12 @@ <!-- Dublin Core properties go here --> <dc:title> <xsl:variable name="title"> <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']"> - <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/> - - - - - - + <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/> + </xsl:for-each> </xsl:variable> <xsl:choose> <xsl:when test="normalize-space($title) != ''"> <xsl:value-of select="$title"/> @@ -6199,25 +6300,22 @@ </xsl:choose> </dc:title> <dc:creator> <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']"> - <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']"> - <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/> - <xsl:if test="position() != last()">; </xsl:if> - </xsl:for-each> - - - + <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']"> + <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/> + <xsl:if test="position() != last()">; </xsl:if> + </xsl:for-each> + </xsl:for-each> </dc:creator> <dc:description> <xsl:variable name="abstract"> - <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/> - - + <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/> + </xsl:variable> <xsl:value-of select="normalize-space($abstract)"/> </dc:description> <pdf:Keywords> <xsl:call-template name="insertKeywords"/> @@ -6233,11 +6331,10 @@ <xsl:choose> <xsl:when test="../@id"> <xsl:value-of select="../@id"/> </xsl:when> <xsl:otherwise> - <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> --> <xsl:value-of select="concat(generate-id(..), '_', text())"/> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template name="getLevel"> <xsl:param name="depth"/> @@ -6259,13 +6356,10 @@ <xsl:value-of select="$level_total - 1"/> </xsl:when> <xsl:when test="ancestor::*[local-name() = 'preface']"> <xsl:value-of select="$level_total - 2"/> </xsl:when> - <!-- <xsl:when test="parent::*[local-name() = 'sections']"> - <xsl:value-of select="$level_total - 1"/> - </xsl:when> --> <xsl:when test="ancestor::*[local-name() = 'sections']"> <xsl:value-of select="$level_total - 1"/> </xsl:when> <xsl:when test="ancestor::*[local-name() = 'bibliography']"> <xsl:value-of select="$level_total - 1"/> @@ -6451,11 +6545,10 @@ </xsl:call-template> </xsl:variable> <xsl:value-of select="$key_"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="setTrackChangesStyles"> <xsl:param name="isAdded"/> <xsl:param name="isDeleted"/> <xsl:choose> <xsl:when test="local-name() = 'math'"> @@ -6474,11 +6567,10 @@ <xsl:if test="$isDeleted = 'true'"> <xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute> <xsl:if test="local-name() = 'table'"> <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute> </xsl:if> - <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> --> <xsl:attribute name="padding">2mm</xsl:attribute> </xsl:if> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:variable name="LRM" select="'‎'"/><xsl:variable name="RLM" select="'‏'"/><xsl:template name="setWritingMode"> @@ -6494,18 +6586,21 @@ <xsl:value-of select="$align"/> </xsl:when> </xsl:choose> </xsl:template><xsl:template name="setTextAlignment"> <xsl:param name="default">left</xsl:param> + <xsl:variable name="align" select="normalize-space(@align)"/> <xsl:attribute name="text-align"> <xsl:choose> - <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when> + <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 != '' 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> </xsl:attribute> - <xsl:if test="@align = 'indent'"> + <xsl:if test="$align = 'indent'"> <xsl:attribute name="margin-left">7mm</xsl:attribute> </xsl:if> </xsl:template><xsl:template name="number-to-words"> <xsl:param name="number"/> <xsl:param name="first"/> \ No newline at end of file