lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-2.3.9 vs lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-2.3.10

- old
+ new

@@ -421,178 +421,28 @@ </svg> </fo:instream-foreign-object> </fo:block> </fo:block-container> - <fo:block color="{$color_blue}"> + <!-- Contents, Abstract, Keywords, Preface, Submitting Organizations, Submitters --> - <xsl:variable name="title-toc"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-toc'"/> - </xsl:call-template> - </xsl:variable> + <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> + <xsl:sort select="@displayorder" data-type="number"/> - <fo:block-container margin-left="-18mm"> - <fo:block-container margin-left="0mm"> - <fo:block margin-bottom="40pt"> - <fo:block font-size="33pt" margin-bottom="4pt" role="H1"> - <xsl:call-template name="addLetterSpacing"> - <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/> - <xsl:with-param name="letter-spacing" select="1.1"/> - </xsl:call-template> - </fo:block> - <fo:block-container width="22.5mm" border-bottom="2pt solid {$color_design}"> - <fo:block margin-top="4pt"> </fo:block> - </fo:block-container> - </fo:block> - </fo:block-container> - </fo:block-container> - - <fo:block-container line-height="130%"> - <fo:block role="TOC"> - <xsl:for-each select="$contents//item[@display = 'true' and normalize-space(@id) != '']"> - - <fo:block role="TOCI"> - <xsl:if test="@level = 1"> - <xsl:attribute name="margin-top">14pt</xsl:attribute> - </xsl:if> - <xsl:if test="@level = 1 or @parent = 'annex'"> - <xsl:attribute name="font-size">12pt</xsl:attribute> - </xsl:if> - <xsl:if test="@level &gt;= 2"> <!-- and not(@parent = 'annex') --> - <xsl:attribute name="font-size">10pt</xsl:attribute> - </xsl:if> - - <xsl:choose> - <xsl:when test="@level = 1"> - <fo:list-block provisional-distance-between-starts="8mm"> - <xsl:if test="@type = 'annex'"> - <xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute> - </xsl:if> - <fo:list-item> - <fo:list-item-label end-indent="label-end()"> - <fo:block> - <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/> - </fo:block> - </fo:list-item-label> - <fo:list-item-body start-indent="body-start()"> - <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm"> - <fo:basic-link internal-destination="{@id}"> - <xsl:call-template name="setAltText"> - <xsl:with-param name="value" select="text()"/> - </xsl:call-template> - <xsl:variable name="sectionTitle"> - <xsl:apply-templates select="title"/> - </xsl:variable> - <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($sectionTitle))"/> - <xsl:text> </xsl:text> - <fo:inline keep-together.within-line="always"> - <fo:leader leader-pattern="dots"/> - <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline> - </fo:inline> - </fo:basic-link> - </fo:block> - </fo:list-item-body> - </fo:list-item> - </fo:list-block> - </xsl:when> - <xsl:otherwise> - <xsl:variable name="margin-left"> - <xsl:choose> - <xsl:when test="number(@level) != 'NaN'"><xsl:value-of select="(@level - 1) * 8"/></xsl:when> - <xsl:otherwise>8</xsl:otherwise> - </xsl:choose> - </xsl:variable> - <fo:block text-align-last="justify" margin-left="{$margin-left}mm"> - <fo:basic-link internal-destination="{@id}"> - <xsl:call-template name="setAltText"> - <xsl:with-param name="value" select="text()"/> - </xsl:call-template> - <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/> - <xsl:text> </xsl:text> - <xsl:apply-templates select="title"/> - <xsl:text> </xsl:text> - <fo:inline keep-together.within-line="always"> - <fo:leader leader-pattern="dots"/> - <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline> - </fo:inline> - </fo:basic-link> - </fo:block> - </xsl:otherwise> - </xsl:choose> - - </fo:block> - </xsl:for-each> - </fo:block> - </fo:block-container> - - <!-- List of Tables --> - <xsl:if test="$contents//tables/table"> - <xsl:call-template name="insertListOf_Title"> - <xsl:with-param name="title" select="$title-list-tables"/> - </xsl:call-template> - <fo:block-container line-height="130%"> - <xsl:for-each select="$contents//tables/table"> - <xsl:call-template name="insertListOf_Item"/> - </xsl:for-each> - </fo:block-container> + <xsl:if test="local-name() = 'foreword' or (local-name() = 'clause' and @type = 'security') or (local-name() = 'clause' and @type = 'submitting_orgs') or local-name() = 'introduction'"> + <fo:block break-after="page"/> </xsl:if> - <!-- List of Figures --> - <xsl:if test="$contents//figures/figure"> - <xsl:call-template name="insertListOf_Title"> - <xsl:with-param name="title" select="$title-list-figures"/> - </xsl:call-template> - <fo:block-container line-height="130%"> - <xsl:for-each select="$contents//figures/figure"> - <xsl:call-template name="insertListOf_Item"/> - </xsl:for-each> - </fo:block-container> - </xsl:if> - - <!-- List of Recommendations --> - <xsl:if test="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> - <xsl:call-template name="insertListOf_Title"> - <xsl:with-param name="title" select="$title-list-recommendations"/> - </xsl:call-template> - <fo:block-container line-height="130%"> - <xsl:for-each select="xalan:nodeset($toc_recommendations)/*[normalize-space(@id) != '']"> - <fo:block text-align-last="justify" margin-top="6pt" role="TOCI"> - <fo:basic-link internal-destination="{@id}"> - <xsl:call-template name="setAltText"> - <xsl:with-param name="value" select="@alt-text"/> - </xsl:call-template> - <xsl:copy-of select="title/node()"/> - <xsl:text> </xsl:text> - <fo:inline keep-together.within-line="always"> - <fo:leader leader-pattern="dots"/> - <fo:page-number-citation ref-id="{@id}"/> - </fo:inline> - </fo:basic-link> - </fo:block> - </xsl:for-each> - </fo:block-container> - </xsl:if> - - </fo:block> - - <fo:block break-after="page"/> - - <fo:block line-height="125%"> - <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters --> - - <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> - <xsl:sort select="@displayorder" data-type="number"/> - - <xsl:if test="local-name() = 'foreword' or (local-name() = 'clause' and @type = 'security') or (local-name() = 'clause' and @type = 'submitting_orgs') or local-name() = 'introduction'"> - <fo:block break-after="page"/> + <fo:block> + <xsl:if test="not(local-name() = 'clause' and @type = 'toc')"> + <xsl:attribute name="line-height">125%</xsl:attribute> </xsl:if> <xsl:apply-templates select="."/> - </xsl:for-each> + </fo:block> + </xsl:for-each> - </fo:block> </fo:flow> </fo:page-sequence> <!-- Document Pages --> <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"> @@ -654,10 +504,174 @@ </fo:inline> </fo:basic-link> </fo:block> </xsl:template> + <xsl:template match="ogc:preface/ogc:clause[@type = 'toc']" priority="4"> + <fo:block color="{$color_blue}"> + + <xsl:apply-templates/> + + <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC --> + + <fo:block-container line-height="130%"> + <fo:block role="TOC"> + <xsl:for-each select="$contents//item[@display = 'true' and normalize-space(@id) != '']"> + + <fo:block role="TOCI"> + <xsl:if test="@level = 1"> + <xsl:attribute name="margin-top">14pt</xsl:attribute> + </xsl:if> + <xsl:if test="@level = 1 or @parent = 'annex'"> + <xsl:attribute name="font-size">12pt</xsl:attribute> + </xsl:if> + <xsl:if test="@level &gt;= 2"> <!-- and not(@parent = 'annex') --> + <xsl:attribute name="font-size">10pt</xsl:attribute> + </xsl:if> + + <xsl:choose> + <xsl:when test="@level = 1"> + <fo:list-block provisional-distance-between-starts="8mm"> + <xsl:if test="@type = 'annex'"> + <xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute> + </xsl:if> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block> + <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/> + </fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm"> + <fo:basic-link internal-destination="{@id}"> + <xsl:call-template name="setAltText"> + <xsl:with-param name="value" select="text()"/> + </xsl:call-template> + <xsl:variable name="sectionTitle"> + <xsl:apply-templates select="title"/> + </xsl:variable> + <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($sectionTitle))"/> + <xsl:text> </xsl:text> + <fo:inline keep-together.within-line="always"> + <fo:leader leader-pattern="dots"/> + <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline> + </fo:inline> + </fo:basic-link> + </fo:block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="margin-left"> + <xsl:choose> + <xsl:when test="number(@level) != 'NaN'"><xsl:value-of select="(@level - 1) * 8"/></xsl:when> + <xsl:otherwise>8</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <fo:block text-align-last="justify" margin-left="{$margin-left}mm"> + <fo:basic-link internal-destination="{@id}"> + <xsl:call-template name="setAltText"> + <xsl:with-param name="value" select="text()"/> + </xsl:call-template> + <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="title"/> + <xsl:text> </xsl:text> + <fo:inline keep-together.within-line="always"> + <fo:leader leader-pattern="dots"/> + <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline> + </fo:inline> + </fo:basic-link> + </fo:block> + </xsl:otherwise> + </xsl:choose> + + </fo:block> + </xsl:for-each> + </fo:block> + </fo:block-container> + + <!-- List of Tables --> + <xsl:if test="$contents//tables/table"> + <xsl:call-template name="insertListOf_Title"> + <xsl:with-param name="title" select="$title-list-tables"/> + </xsl:call-template> + <fo:block-container line-height="130%"> + <xsl:for-each select="$contents//tables/table"> + <xsl:call-template name="insertListOf_Item"/> + </xsl:for-each> + </fo:block-container> + </xsl:if> + + <!-- List of Figures --> + <xsl:if test="$contents//figures/figure"> + <xsl:call-template name="insertListOf_Title"> + <xsl:with-param name="title" select="$title-list-figures"/> + </xsl:call-template> + <fo:block-container line-height="130%"> + <xsl:for-each select="$contents//figures/figure"> + <xsl:call-template name="insertListOf_Item"/> + </xsl:for-each> + </fo:block-container> + </xsl:if> + + <!-- List of Recommendations --> + <xsl:if test="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> + <xsl:call-template name="insertListOf_Title"> + <xsl:with-param name="title" select="$title-list-recommendations"/> + </xsl:call-template> + <fo:block-container line-height="130%"> + <xsl:for-each select="xalan:nodeset($toc_recommendations)/*[normalize-space(@id) != '']"> + <fo:block text-align-last="justify" margin-top="6pt" role="TOCI"> + <fo:basic-link internal-destination="{@id}"> + <xsl:call-template name="setAltText"> + <xsl:with-param name="value" select="@alt-text"/> + </xsl:call-template> + <xsl:copy-of select="title/node()"/> + <xsl:text> </xsl:text> + <fo:inline keep-together.within-line="always"> + <fo:leader leader-pattern="dots"/> + <fo:page-number-citation ref-id="{@id}"/> + </fo:inline> + </fo:basic-link> + </fo:block> + </xsl:for-each> + </fo:block-container> + </xsl:if> + </xsl:if> + </fo:block> + + <fo:block break-after="page"/> + + </xsl:template> + + <xsl:template match="ogc:preface/ogc:clause[@type = 'toc']/ogc:title" priority="3"> + <xsl:variable name="title-toc"> + <xsl:apply-templates/> + <!-- <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-toc'"/> + </xsl:call-template> --> + </xsl:variable> + + <fo:block-container margin-left="-18mm"> + <fo:block-container margin-left="0mm"> + <fo:block margin-bottom="40pt"> + <fo:block font-size="33pt" margin-bottom="4pt" role="H1"> + <xsl:call-template name="addLetterSpacing"> + <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/> + <xsl:with-param name="letter-spacing" select="1.1"/> + </xsl:call-template> + </fo:block> + <fo:block-container width="22.5mm" border-bottom="2pt solid {$color_design}"> + <fo:block margin-top="4pt"> </fo:block> + </fo:block-container> + </fo:block> + </fo:block-container> + </fo:block-container> + </xsl:template> + <!-- Lato font doesn't contain 'thin space' glyph --> <xsl:template match="text()" priority="1"> <xsl:value-of select="translate(., $thin_space, ' ')"/> </xsl:template> @@ -737,11 +751,11 @@ <!-- ============================= --> <!-- CONTENTS --> <!-- ============================= --> <!-- element with title --> - <xsl:template match="*[ogc:title]" mode="contents"> + <xsl:template match="*[ogc:title][not(@type = 'toc')]" mode="contents"> <xsl:variable name="level"> <xsl:call-template name="getLevel"> <xsl:with-param name="depth" select="ogc:title/@depth"/> </xsl:call-template> </xsl:variable> @@ -1881,10 +1895,14 @@ <xsl:attribute name="text-decoration">underline</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_link-style"> + + </xsl:template> <!-- refine_link-style --> + <xsl:attribute-set name="sourcecode-container-style"> </xsl:attribute-set> <xsl:attribute-set name="sourcecode-style"> @@ -1896,10 +1914,18 @@ <xsl:attribute name="margin-bottom">6pt</xsl:attribute> <xsl:attribute name="line-height">113%</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_sourcecode-style"> + + <xsl:if test="parent::*[local-name() = 'example']"> + <xsl:attribute name="margin-bottom">0pt</xsl:attribute> + </xsl:if> + + </xsl:template> <!-- refine_sourcecode-style --> + <xsl:attribute-set name="pre-style"> <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> <xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute> @@ -2018,10 +2044,14 @@ <xsl:attribute name="margin-top">10pt</xsl:attribute> <xsl:attribute name="margin-bottom">10pt</xsl:attribute> </xsl:attribute-set> <!-- example-style --> + <xsl:template name="refine_example-style"> + + </xsl:template> <!-- refine_example-style --> + <xsl:attribute-set name="example-body-style"> </xsl:attribute-set> <!-- example-body-style --> <xsl:attribute-set name="example-name-style"> @@ -2034,10 +2064,14 @@ <xsl:attribute name="margin-bottom">14pt</xsl:attribute> </xsl:attribute-set> <!-- example-p-style --> + <xsl:template name="refine_example-p-style"> + + </xsl:template> <!-- refine_example-p-style --> + <xsl:attribute-set name="termexample-name-style"> <xsl:attribute name="padding-right">10mm</xsl:attribute> </xsl:attribute-set> <!-- termexample-name-style --> @@ -2061,16 +2095,33 @@ <xsl:attribute name="space-after">12pt</xsl:attribute> </xsl:attribute-set> <!-- table-container-style --> + <xsl:template name="refine_table-container-style"> + <xsl:param name="margin-side"/> + + <!-- <xsl:if test="ancestor::*[local-name()='sections']"> --> + <xsl:attribute name="font-size">9pt</xsl:attribute> + <!-- </xsl:if> --> + + <!-- end table block-container attributes --> + </xsl:template> <!-- refine_table-container-style --> + <xsl:attribute-set name="table-style"> <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute> <xsl:attribute name="table-layout">fixed</xsl:attribute> </xsl:attribute-set><!-- table-style --> + <xsl:template name="refine_table-style"> + <xsl:param name="margin-side"/> + + <xsl:call-template name="setBordersTableArray"/> + + </xsl:template> <!-- refine_table-style --> + <xsl:attribute-set name="table-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> @@ -2078,10 +2129,15 @@ <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute> <xsl:attribute name="font-size">11pt</xsl:attribute> </xsl:attribute-set> <!-- table-name-style --> + <xsl:template name="refine_table-name-style"> + <xsl:param name="continued"/> + + </xsl:template> <!-- refine_table-name-style --> + <xsl:attribute-set name="table-row-style"> <xsl:attribute name="min-height">4mm</xsl:attribute> <xsl:attribute name="min-height">8.5mm</xsl:attribute> @@ -2093,18 +2149,42 @@ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute> <xsl:attribute name="color">white</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_table-header-row-style"> + + <xsl:call-template name="setBordersTableArray"/> + + </xsl:template> <!-- refine_table-header-row-style --> + <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style"> </xsl:attribute-set> + <xsl:template name="refine_table-footer-row-style"> + + </xsl:template> <!-- refine_table-footer-row-style --> + <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style"> </xsl:attribute-set> + <xsl:template name="refine_table-body-row-style"> + + <xsl:call-template name="setBordersTableArray"/> + + <xsl:variable name="number"><xsl:number/></xsl:variable> + <xsl:attribute name="background-color"> + <xsl:choose> + <xsl:when test="$number mod 2 = 0">rgb(252, 246, 222)</xsl:when> + <xsl:otherwise>rgb(254, 252, 245)</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + + </xsl:template> <!-- refine_table-body-row-style --> + <xsl:attribute-set name="table-header-cell-style"> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="padding-left">1mm</xsl:attribute> <xsl:attribute name="padding-right">1mm</xsl:attribute> <xsl:attribute name="display-align">center</xsl:attribute> @@ -2113,10 +2193,28 @@ <xsl:attribute name="padding-bottom">1mm</xsl:attribute> <xsl:attribute name="border">solid black 0pt</xsl:attribute> </xsl:attribute-set> <!-- table-header-cell-style --> + <xsl:template name="refine_table-header-cell-style"> + + <xsl:call-template name="setBordersTableArray"/> + + <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend') and normalize-space(@align) = ''"> + <xsl:call-template name="setTextAlignment"> + <xsl:with-param name="default">left</xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:if test="$lang = 'ar'"> + <xsl:attribute name="padding-right">1mm</xsl:attribute> + </xsl:if> + + <xsl:call-template name="setTableCellAttributes"/> + + </xsl:template> <!-- refine_table-header-cell-style --> + <xsl:attribute-set name="table-cell-style"> <xsl:attribute name="display-align">center</xsl:attribute> <xsl:attribute name="padding-left">1mm</xsl:attribute> <xsl:attribute name="padding-right">1mm</xsl:attribute> @@ -2124,26 +2222,46 @@ <xsl:attribute name="padding-top">1mm</xsl:attribute> <xsl:attribute name="padding-bottom">1mm</xsl:attribute> </xsl:attribute-set> <!-- table-cell-style --> + <xsl:template name="refine_table-cell-style"> + + <xsl:if test="$lang = 'ar'"> + <xsl:attribute name="padding-right">1mm</xsl:attribute> + </xsl:if> + + <!-- bsi --> + + <xsl:call-template name="setBordersTableArray"/> + + </xsl:template> <!-- refine_table-cell-style --> + <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 name="border">solid black 0pt</xsl:attribute> </xsl:attribute-set> <!-- table-footer-cell-style --> + <xsl:template name="refine_table-footer-cell-style"> + + </xsl:template> <!-- refine_table-footer-cell-style --> + <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><!-- table-note-style --> + <xsl:template name="refine_table-note-style"> + + </xsl:template> <!-- refine_table-note-style --> + <xsl:attribute-set name="table-fn-style"> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> </xsl:attribute-set> <!-- table-fn-style --> @@ -2203,17 +2321,37 @@ <xsl:attribute name="padding-right">5mm</xsl:attribute> <xsl:attribute name="padding-left">1mm</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_dt-cell-style"> + + <xsl:if test="not(ancestor::ogc:sourcecode)"> + <!-- <xsl:attribute name="border-left">1pt solid <xsl:value-of select="$color_design"/></xsl:attribute> --> + <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dt"/></xsl:attribute> + </xsl:if> + + </xsl:template> <!-- refine_dt-cell-style --> + <xsl:attribute-set name="dt-block-style"> <xsl:attribute name="margin-top">0pt</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_dt-block-style"> + + <xsl:if test="ancestor::ogc:sourcecode"> + <xsl:attribute name="margin-bottom">2pt</xsl:attribute> + </xsl:if> + <xsl:if test="not(following-sibling::ogc:dt)"> <!-- last dt --> + <xsl:attribute name="margin-bottom">0</xsl:attribute> + </xsl:if> + + </xsl:template> <!-- refine_dt-block-style --> + <xsl:attribute-set name="dl-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> <xsl:attribute name="font-weight">normal</xsl:attribute> @@ -2226,10 +2364,18 @@ <xsl:attribute name="padding-top">0.5mm</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_dd-cell-style"> + + <xsl:if test="not(ancestor::ogc:sourcecode)"> + <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dd"/></xsl:attribute> + </xsl:if> + + </xsl:template> <!-- refine_dd-cell-style --> + <!-- ========================== --> <!-- END Definition's list styles --> <!-- ========================== --> <xsl:attribute-set name="appendix-style"> @@ -2248,40 +2394,61 @@ <xsl:attribute name="margin-bottom">8pt</xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="xref-style"> - <xsl:attribute name="keep-together.within-line">always</xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="eref-style"> </xsl:attribute-set> + <xsl:template name="refine_eref-style"> + <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()"/> + + </xsl:template> <!-- refine_eref-style --> + <xsl:attribute-set name="note-style"> <xsl:attribute name="margin-top">12pt</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_note-style"> + + <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)"> + <xsl:attribute name="margin-bottom">0pt</xsl:attribute> + </xsl:if> + + </xsl:template> + <xsl:variable name="note-body-indent">10mm</xsl:variable> <xsl:variable name="note-body-indent-table">5mm</xsl:variable> <xsl:attribute-set name="note-name-style"> <xsl:attribute name="font-weight">bold</xsl:attribute> <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> --> </xsl:attribute-set> + <xsl:template name="refine_note-name-style"> + + </xsl:template> <!-- refine_note-name-style --> + <xsl:attribute-set name="table-note-name-style"> <xsl:attribute name="padding-right">2mm</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_table-note-name-style"> + + </xsl:template> <!-- refine_table-note-name-style --> + <xsl:attribute-set name="note-p-style"> <xsl:attribute name="margin-top">12pt</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> @@ -2292,17 +2459,25 @@ <xsl:attribute name="margin-top">12pt</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_termnote-style"> + + </xsl:template> <!-- refine_termnote-style --> + <xsl:attribute-set name="termnote-name-style"> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_termnote-name-style"> + + </xsl:template> + <xsl:attribute-set name="termnote-p-style"> <xsl:attribute name="space-before">4pt</xsl:attribute> </xsl:attribute-set> @@ -2314,10 +2489,14 @@ <xsl:attribute name="margin-top">12pt</xsl:attribute> <xsl:attribute name="margin-left">13mm</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_quote-style"> + + </xsl:template> + <xsl:attribute-set name="quote-source-style"> <xsl:attribute name="text-align">right</xsl:attribute> <xsl:attribute name="margin-right">25mm</xsl:attribute> @@ -2328,10 +2507,14 @@ <xsl:attribute name="margin-bottom">12pt</xsl:attribute> <xsl:attribute name="keep-with-previous">always</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_termsource-style"> + + </xsl:template> <!-- refine_termsource-style --> + <xsl:attribute-set name="termsource-text-style"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:attribute-set> @@ -2370,10 +2553,14 @@ <xsl:attribute name="keep-with-previous">always</xsl:attribute> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_figure-name-style"> + + </xsl:template> <!-- refine_figure-name-style --> + <xsl:attribute-set name="figure-source-style"> </xsl:attribute-set> <!-- Formula's styles --> @@ -2388,10 +2575,14 @@ <xsl:attribute name="text-align">left</xsl:attribute> </xsl:attribute-set> <!-- formula-stem-block-style --> + <xsl:template name="refine_formula-stem-block-style"> + + </xsl:template> <!-- refine_formula-stem-block-style --> + <xsl:attribute-set name="formula-stem-number-style"> <xsl:attribute name="text-align">right</xsl:attribute> </xsl:attribute-set> <!-- formula-stem-number-style --> <!-- End Formula's styles --> @@ -2402,10 +2593,14 @@ <xsl:attribute name="space-before">12pt</xsl:attribute> <xsl:attribute name="space-after">6pt</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_image-style"> + + </xsl:template> + <xsl:attribute-set name="figure-pseudocode-p-style"> </xsl:attribute-set> <xsl:attribute-set name="image-graphic-style"> @@ -2494,18 +2689,26 @@ <xsl:attribute-set name="mathml-style"> <xsl:attribute name="font-family">STIX Two Math</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_mathml-style"> + + </xsl:template> + <xsl:attribute-set name="list-style"> <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute> <xsl:attribute name="space-after">12pt</xsl:attribute> <xsl:attribute name="line-height">115%</xsl:attribute> </xsl:attribute-set> <!-- list-style --> + <xsl:template name="refine_list-style"> + + </xsl:template> <!-- refine_list-style --> + <xsl:attribute-set name="list-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="font-weight">normal</xsl:attribute> <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute> @@ -2514,20 +2717,40 @@ <xsl:attribute-set name="list-item-style"> </xsl:attribute-set> + <xsl:template name="refine_list-item-style"> + + </xsl:template> <!-- refine_list-item-style --> + <xsl:attribute-set name="list-item-label-style"> </xsl:attribute-set> + <xsl:template name="refine_list-item-label-style"> + + </xsl:template> <!-- refine_list-item-label-style --> + <xsl:attribute-set name="list-item-body-style"> <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_list-item-body-style"> + + <xsl:attribute name="margin-bottom">10pt</xsl:attribute> + <xsl:if test="ancestor::ogc:table[not(@class)]"> + <xsl:attribute name="margin-bottom">1mm</xsl:attribute> + </xsl:if> + <xsl:if test="not(following-sibling::*) and not(../following-sibling::*)"> + <xsl:attribute name="margin-bottom">0pt</xsl:attribute> + </xsl:if> + + </xsl:template> <!-- refine_list-item-body-style --> + <xsl:attribute-set name="toc-style"> <xsl:attribute name="line-height">135%</xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="fn-reference-style"> @@ -2536,10 +2759,14 @@ <xsl:attribute name="vertical-align">super</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_fn-reference-style"> + + </xsl:template> <!-- refine_fn-reference-style --> + <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"> @@ -2562,18 +2789,26 @@ <xsl:attribute name="line-height">124%</xsl:attribute> <xsl:attribute name="text-align">justify</xsl:attribute> </xsl:attribute-set> + <xsl:template name="refine_fn-body-style"> + + </xsl:template> <!-- refine_fn-body-style --> + <xsl:attribute-set name="fn-body-num-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> <!-- fn-body-num-style --> + <xsl:template name="refine_fn-body-num-style"> + + </xsl:template> <!-- refine_fn-body-num-style --> + <!-- admonition --> <xsl:attribute-set name="admonition-style"> <xsl:attribute name="border">0.5pt solid rgb(79, 129, 189)</xsl:attribute> <xsl:attribute name="color">rgb(79, 129, 189)</xsl:attribute> @@ -3240,16 +3475,14 @@ </xsl:choose> </xsl:variable> <fo:block-container xsl:use-attribute-sets="table-container-style"> - <!-- <xsl:if test="ancestor::*[local-name()='sections']"> --> - <xsl:attribute name="font-size">9pt</xsl:attribute> - <!-- </xsl:if> --> + <xsl:call-template name="refine_table-container-style"> + <xsl:with-param name="margin-side" select="$margin-side"/> + </xsl:call-template> - <!-- 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) --> @@ -3271,11 +3504,13 @@ <xsl:attribute name="margin-right">0mm</xsl:attribute> </xsl:if> <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute> - <xsl:call-template name="setBordersTableArray"/> + <xsl:call-template name="refine_table-style"> + <xsl:with-param name="margin-side" select="$margin-side"/> + </xsl:call-template> </xsl:element> </xsl:variable> <xsl:if test="$isGenerateTableIF = 'true'"> @@ -3337,11 +3572,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 select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely --> + <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely --> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> @@ -3424,10 +3659,14 @@ <xsl:param name="continued"/> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="table-name-style"> + <xsl:call-template name="refine_table-name-style"> + <xsl:with-param name="continued" select="$continued"/> + </xsl:call-template> + <xsl:choose> <xsl:when test="$continued = 'true'"> </xsl:when> <xsl:otherwise> @@ -3806,10 +4045,12 @@ <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:call-template name="refine_table-header-title-style"/> + <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']"> <xsl:with-param name="continued">true</xsl:with-param> </xsl:apply-templates> <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name --> @@ -3818,10 +4059,14 @@ </fo:table-cell> </fo:table-row> </xsl:template> <!-- table-header-title --> + <xsl:template name="refine_table-header-title-style"> + + </xsl:template> <!-- refine_table-header-title-style --> + <xsl:template match="*[local-name()='thead']" mode="process_tbody"> <fo:table-body> <xsl:apply-templates/> </fo:table-body> </xsl:template> @@ -3842,11 +4087,11 @@ <xsl:template name="insertTableFooterInSeparateTable"> <xsl:param name="table_attributes"/> <xsl:param name="colwidths"/> <xsl:param name="colgroup"/> - <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/> + <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/> <xsl:variable name="isNoteOrFnExistShowAfterTable"> </xsl:variable> @@ -3902,18 +4147,21 @@ <fo:table-body> <fo:table-row> <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}"> + <xsl:call-template name="refine_table-footer-cell-style"/> + <xsl:call-template name="setBordersTableArray"/> <!-- fn will be processed inside 'note' processing --> <!-- for BSI (not PAS) display Notes before footnotes --> <!-- except gb and bsi --> + <xsl:apply-templates select="../*[local-name()='p']"/> <xsl:apply-templates select="../*[local-name()='dl']"/> <xsl:apply-templates select="../*[local-name()='note']"/> <xsl:apply-templates select="../*[local-name()='source']"/> <xsl:variable name="isDisplayRowSeparator"> @@ -4041,11 +4289,11 @@ <!-- ===================== --> <!-- row in table header (thead) thead/tr --> <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="setBordersTableArray"/> + <xsl:call-template name="refine_table-header-row-style"/> <xsl:call-template name="setTableRowAttributes"/> <xsl:apply-templates/> </fo:table-row> @@ -4075,10 +4323,12 @@ <!-- row in table footer (tfoot), tfoot/tr --> <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="refine_table-footer-row-style"/> + <xsl:call-template name="setTableRowAttributes"/> <xsl:apply-templates/> </fo:table-row> </xsl:template> @@ -4088,21 +4338,14 @@ <xsl:if test="count(*) = count(*[local-name() = 'th'])"> <!-- row contains 'th' only --> <xsl:attribute name="keep-with-next">always</xsl:attribute> </xsl:if> - <xsl:call-template name="setBordersTableArray"/> + <xsl:call-template name="refine_table-body-row-style"/> - <xsl:variable name="number"><xsl:number/></xsl:variable> - <xsl:attribute name="background-color"> - <xsl:choose> - <xsl:when test="$number mod 2 = 0">rgb(252, 246, 222)</xsl:when> - <xsl:otherwise>rgb(254, 252, 245)</xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:call-template name="setTableRowAttributes"/> + <xsl:apply-templates/> </fo:table-row> </xsl:template> <xsl:template name="setTableRowAttributes"> @@ -4117,24 +4360,12 @@ <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:call-template name="setBordersTableArray"/> + <xsl:call-template name="refine_table-header-cell-style"/> - <xsl:if test="starts-with(ancestor::*[local-name() = 'table'][1]/@type, 'recommend') and normalize-space(@align) = ''"> - <xsl:call-template name="setTextAlignment"> - <xsl:with-param name="default">left</xsl:with-param> - </xsl:call-template> - </xsl:if> - - <xsl:if test="$lang = 'ar'"> - <xsl:attribute name="padding-right">1mm</xsl:attribute> - </xsl:if> - - <xsl:call-template name="setTableCellAttributes"/> - <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> </xsl:template> <!-- cell in table header row - 'th' --> @@ -4171,18 +4402,12 @@ <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> + <xsl:call-template name="refine_table-cell-style"/> - <!-- bsi --> - - <xsl:call-template name="setBordersTableArray"/> - <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table --> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> <xsl:call-template name="setTableCellAttributes"/> @@ -4208,13 +4433,17 @@ <xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"> <fo:block xsl:use-attribute-sets="table-note-style"> + <xsl:call-template name="refine_table-note-style"/> + <!-- Table's note name (NOTE, for example) --> <fo:inline xsl:use-attribute-sets="table-note-name-style"> + <xsl:call-template name="refine_table-note-name-style"/> + <xsl:apply-templates select="*[local-name() = 'name']"/> </fo:inline> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> @@ -4238,10 +4467,18 @@ <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"> <!-- list of footnotes to calculate actual footnotes number --> <xsl:variable name="p_fn_"> <xsl:call-template name="get_fn_list"/> + <!-- <xsl:choose> + <xsl:when test="$namespace = 'jis'"> + <xsl:call-template name="get_fn_list_for_element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="get_fn_list"/> + </xsl:otherwise> + </xsl:choose> --> </xsl:variable> <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/> <xsl:variable name="gen_id" select="generate-id(.)"/> <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/> @@ -4262,11 +4499,18 @@ <xsl:variable name="current_fn_number_text"> <xsl:value-of select="$current_fn_number"/> </xsl:variable> - <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/> + <xsl:variable name="ref_id"> + <xsl:choose> + <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> <xsl:variable name="footnote_inline"> <fo:inline> <xsl:variable name="fn_styles"> <xsl:choose> @@ -4288,11 +4532,11 @@ </xsl:if> <xsl:call-template name="insert_basic_link"> <xsl:with-param name="element"> <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> - <xsl:value-of select="$current_fn_number_text"/> + <xsl:copy-of select="$current_fn_number_text"/> </fo:basic-link> </xsl:with-param> </xsl:call-template> </fo:inline> </xsl:variable> @@ -4308,12 +4552,16 @@ <fo:block-container xsl:use-attribute-sets="fn-container-body-style"> <fo:block xsl:use-attribute-sets="fn-body-style"> + <xsl:call-template name="refine_fn-body-style"/> + <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style"> + <xsl:call-template name="refine_fn-body-num-style"/> + <xsl:value-of select="$current_fn_number_text"/> </fo:inline> <xsl:apply-templates/> </fo:block> </fo:block-container> @@ -4361,10 +4609,32 @@ </xsl:for-each> </xsl:otherwise> </xsl:choose> </xsl:template> + <xsl:template name="get_fn_list_for_element"> + <xsl:choose> + <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already --> + <fn gen_id="{generate-id(.)}"> + <xsl:copy-of select="@*"/> + <xsl:copy-of select="node()"/> + </fn> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]"> + <xsl:variable name="element_id" select="@id"/> + <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]"> + <!-- copy unique fn --> + <fn gen_id="{generate-id(.)}"> + <xsl:copy-of select="@*"/> + <xsl:copy-of select="node()"/> + </fn> + </xsl:for-each> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </xsl:template> <!-- ============================ --> <!-- table's footnotes rendering --> <!-- ============================ --> <xsl:template name="table_fn_display"> <xsl:variable name="references"> @@ -4541,10 +4811,12 @@ <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) --> <xsl:template match="*[local-name()='fn']"> <fo:inline xsl:use-attribute-sets="fn-reference-style"> + <xsl:call-template name="refine_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:attribute name="internal-destination"> <xsl:value-of select="@reference"/><xsl:text>_</xsl:text> <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/> @@ -4645,10 +4917,12 @@ </xsl:when> <!-- END: only one component --> <xsl:when test="$parent = 'formula'"> <!-- a few components --> <fo:block margin-bottom="12pt" text-align="left"> + <xsl:call-template name="refine_dl_formula_where_style"/> + <!-- <xsl:variable name="title-where"> <xsl:call-template name="getLocalizedString"> <xsl:with-param name="key">where</xsl:with-param> </xsl:call-template> </xsl:variable> @@ -4658,10 +4932,12 @@ </fo:block> </xsl:when> <!-- END: a few components --> <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure --> <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always"> + <xsl:call-template name="refine_figure_key_style"/> + <xsl:variable name="title-key"> <xsl:call-template name="getLocalizedString"> <xsl:with-param name="key">key</xsl:with-param> </xsl:call-template> </xsl:variable> @@ -4672,16 +4948,20 @@ <!-- a few components --> <xsl:if test="$onlyOneComponent = 'false'"> <fo:block> + <xsl:call-template name="refine_multicomponent_style"/> + <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']"> <xsl:attribute name="margin-top">0</xsl:attribute> </xsl:if> <fo:block> + <xsl:call-template name="refine_multicomponent_block_style"/> + <xsl:apply-templates select="*[local-name() = 'name']"> <xsl:with-param name="process">true</xsl:with-param> </xsl:apply-templates> <xsl:if test="$isGenerateTableIF = 'true'"> @@ -4835,10 +5115,28 @@ <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/> </xsl:if> </xsl:template> <!-- END: dl --> + <xsl:template name="refine_dl_formula_where_style"> + + </xsl:template> <!-- refine_dl_formula_where_style --> + + <xsl:template name="refine_figure_key_style"> + + </xsl:template> <!-- refine_figure_key_style --> + + <xsl:template name="refine_multicomponent_style"> + <xsl:variable name="parent" select="local-name(..)"/> + + </xsl:template> <!-- refine_multicomponent_style --> + + <xsl:template name="refine_multicomponent_block_style"> + <xsl:variable name="parent" select="local-name(..)"/> + + </xsl:template> <!-- refine_multicomponent_block_style --> + <!-- ignore 'p' with 'where' in formula, before 'dl' --> <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/> <xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']"> <xsl:param name="process">false</xsl:param> @@ -5061,28 +5359,20 @@ <xsl:attribute name="padding-left">6mm</xsl:attribute> <!-- <xsl:attribute name="padding-left">6.5mm</xsl:attribute> --> </xsl:if> - <xsl:if test="not(ancestor::ogc:sourcecode)"> - <!-- <xsl:attribute name="border-left">1pt solid <xsl:value-of select="$color_design"/></xsl:attribute> --> - <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dt"/></xsl:attribute> - </xsl:if> + <xsl:call-template name="refine_dt-cell-style"/> <fo:block xsl:use-attribute-sets="dt-block-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:if test="ancestor::ogc:sourcecode"> - <xsl:attribute name="margin-bottom">2pt</xsl:attribute> - </xsl:if> - <xsl:if test="not(following-sibling::ogc:dt)"> <!-- last dt --> - <xsl:attribute name="margin-bottom">0</xsl:attribute> - </xsl:if> + <xsl:call-template name="refine_dt-block-style"/> <xsl:apply-templates> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:apply-templates> @@ -5099,13 +5389,11 @@ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- border is mandatory, to calculate real width --> <xsl:attribute name="border">0.1pt solid black</xsl:attribute> </xsl:if> - <xsl:if test="not(ancestor::ogc:sourcecode)"> - <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dd"/></xsl:attribute> - </xsl:if> + <xsl:call-template name="refine_dd-cell-style"/> <fo:block> <xsl:if test="$isGenerateTableIF = 'true'"> <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> @@ -5253,16 +5541,22 @@ <xsl:template match="*[local-name()='strong'] | *[local-name()='b']"> <xsl:param name="split_keep-within-line"/> <fo:inline font-weight="bold"> + <xsl:call-template name="refine_strong_style"/> + <xsl:apply-templates> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:apply-templates> </fo:inline> </xsl:template> + <xsl:template name="refine_strong_style"> + + </xsl:template> + <xsl:template match="*[local-name()='padding']"> <fo:inline padding-right="{@value}"> </fo:inline> </xsl:template> <xsl:template match="*[local-name()='sup']"> @@ -6405,10 +6699,15 @@ <xsl:variable name="isAdded" select="@added"/> <xsl:variable name="isDeleted" select="@deleted"/> <fo:inline xsl:use-attribute-sets="mathml-style"> + <!-- DEBUG --> + <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> --> + + <xsl:call-template name="refine_mathml-style"/> + <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element --> <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> --> </xsl:if> <xsl:call-template name="setTrackChangesStyles"> @@ -6509,10 +6808,12 @@ <xsl:apply-templates select="." mode="mathml"/> </xsl:variable> <fo:instream-foreign-object fox:alt-text="Math"> + <xsl:call-template name="refine_mathml_insteam_object_style"/> + <!-- put MathML in Actual Text --> <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> --> <xsl:attribute name="fox:actual-text"> <xsl:value-of select="$mathml_content"/> </xsl:attribute> @@ -6529,10 +6830,14 @@ <xsl:copy-of select="xalan:nodeset($mathml)"/> </fo:instream-foreign-object> </xsl:template> + <xsl:template name="refine_mathml_insteam_object_style"> + + </xsl:template> <!-- refine_mathml_insteam_object_style --> + <xsl:template match="mathml:*" mode="mathml_actual_text"> <!-- <xsl:text>a+b</xsl:text> --> <xsl:text>&lt;</xsl:text> <xsl:value-of select="local-name()"/> <xsl:if test="local-name() = 'math'"> @@ -6673,10 +6978,12 @@ <stem type="AsciiMath"><asciimath>x = 1</asciimath><latexmath>x = 1</latexmath></stem> --> <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3"> <fo:inline xsl:use-attribute-sets="mathml-style"> + <xsl:call-template name="refine_mathml-style"/> + <xsl:choose> <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when> <xsl:otherwise> <xsl:apply-templates> <xsl:with-param name="process">true</xsl:with-param> @@ -6717,10 +7024,12 @@ <xsl:if test="starts-with(normalize-space(@target), 'mailto:') and not(ancestor::*[local-name() = 'td'])"> <xsl:attribute name="keep-together.within-line">always</xsl:attribute> </xsl:if> + <xsl:call-template name="refine_link-style"/> + <xsl:choose> <xsl:when test="$target_text = ''"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> @@ -6808,10 +7117,13 @@ <xsl:template match="*[local-name() = 'xref']"> <xsl:call-template name="insert_basic_link"> <xsl:with-param name="element"> <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style"> + <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://'))"> + <xsl:attribute name="keep-together.within-line">always</xsl:attribute> + </xsl:if> <xsl:if test="parent::*[local-name() = 'add']"> <xsl:call-template name="append_add-style"/> </xsl:if> <xsl:apply-templates/> </fo:basic-link> @@ -6869,10 +7181,12 @@ <fo:table-body> <fo:table-row> <fo:table-cell display-align="center"> <fo:block xsl:use-attribute-sets="formula-stem-block-style"> + <xsl:call-template name="refine_formula-stem-block-style"/> + <xsl:apply-templates/> </fo:block> </fo:table-cell> <fo:table-cell display-align="center"> <fo:block xsl:use-attribute-sets="formula-stem-number-style"> @@ -6910,20 +7224,22 @@ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style"> <xsl:call-template name="setBlockSpanAll"/> - <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)"> - <xsl:attribute name="margin-bottom">0pt</xsl:attribute> - </xsl:if> + <xsl:call-template name="refine_note-style"/> <fo:block-container margin-left="0mm" margin-right="0mm"> <fo:block> + <xsl:call-template name="refine_note_block_style"/> + <fo:inline xsl:use-attribute-sets="note-name-style"> + <xsl:call-template name="refine_note-name-style"/> + <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' --> <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> --> <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]"> <xsl:call-template name="append_add-style"/> </xsl:if> @@ -6945,10 +7261,14 @@ </fo:block-container> </fo:block-container> </xsl:template> + <xsl:template name="refine_note_block_style"> + + </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"> <!-- display first NOTE's paragraph in the same line with label NOTE --> <fo:inline xsl:use-attribute-sets="note-p-style"> @@ -6966,16 +7286,20 @@ <xsl:template match="*[local-name() = 'termnote']"> <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style"> <xsl:call-template name="setBlockSpanAll"/> + <xsl:call-template name="refine_termnote-style"/> + <fo:inline xsl:use-attribute-sets="termnote-name-style"> <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> + <xsl:call-template name="refine_termnote-name-style"/> + <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' --> <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> --> <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]"> <xsl:call-template name="append_add-style"/> </xsl:if> @@ -7145,10 +7469,12 @@ </fo:inline> </xsl:when> <xsl:otherwise> <fo:block xsl:use-attribute-sets="image-style"> + <xsl:call-template name="refine_image-style"/> + <xsl:variable name="src"> <xsl:call-template name="image_src"/> </xsl:variable> <xsl:choose> @@ -8012,10 +8338,12 @@ <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:call-template name="refine_figure-name-style"/> + <xsl:apply-templates/> </fo:block> </xsl:if> </xsl:template> @@ -8284,13 +8612,11 @@ <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> - <xsl:if test="parent::*[local-name() = 'example']"> - <xsl:attribute name="margin-bottom">0pt</xsl:attribute> - </xsl:if> + <xsl:call-template name="refine_sourcecode-style"/> <!-- remove margin between rows in the table with sourcecode line numbers --> <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <xsl:attribute name="margin-top">0pt</xsl:attribute> <xsl:attribute name="margin-bottom">0pt</xsl:attribute> @@ -9018,10 +9344,12 @@ <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style"> <xsl:call-template name="setBlockSpanAll"/> + <xsl:call-template name="refine_example-style"/> + <xsl:variable name="fo_element"> <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if> inline </xsl:variable> @@ -9145,10 +9473,12 @@ <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-right">0mm</xsl:attribute> </xsl:if> <fo:block xsl:use-attribute-sets="example-p-style"> + <xsl:call-template name="refine_example-p-style"/> + <xsl:apply-templates/> </fo:block> </fo:block-container> </xsl:when> <xsl:when test="starts-with(normalize-space($element), 'list')"> @@ -9161,10 +9491,11 @@ <xsl:apply-templates/> </fo:inline> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- example/p --> + <!-- ====== --> <!-- ====== --> <!-- ====== --> <!-- termsource --> @@ -9172,10 +9503,12 @@ <!-- modification --> <!-- ====== --> <xsl:template match="*[local-name() = 'termsource']" name="termsource"> <fo:block xsl:use-attribute-sets="termsource-style"> + <xsl:call-template name="refine_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"/> @@ -9287,10 +9620,12 @@ </xsl:if> <fo:block-container margin-left="0mm"> <fo:block-container xsl:use-attribute-sets="quote-style"> + <xsl:call-template name="refine_quote-style"/> + <fo:block-container margin-left="0mm" margin-right="0mm"> <fo:block role="BlockQuote"> <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source --> </fo:block> </fo:block-container> @@ -9361,21 +9696,22 @@ <xsl:attribute name="vertical-align">super</xsl:attribute> <xsl:attribute name="font-size">80%</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()"/> + <xsl:call-template name="refine_eref-style"/> <xsl:call-template name="insert_basic_link"> <xsl:with-param name="element"> <fo:basic-link fox:alt-text="{@citeas}"> <xsl:if test="normalize-space(@citeas) = ''"> <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute> </xsl:if> <xsl:if test="@type = 'inline'"> + <xsl:call-template name="refine_basic_link_style"/> + </xsl:if> <xsl:choose> <xsl:when test="$external-destination != ''"> <!-- external hyperlink --> <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute> @@ -9404,10 +9740,15 @@ </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> + + <xsl:template name="refine_basic_link_style"> + + </xsl:template> <!-- refine_basic_link_style --> + <!-- ====== --> <!-- END eref --> <!-- ====== --> <!-- Tabulation processing --> @@ -9547,20 +9888,26 @@ <xsl:template match="/*/*[local-name() = 'sections']/*" priority="2"> <fo:block> <xsl:call-template name="setId"/> - <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms --> - <xsl:if test="$pos &gt;= 2"> - <xsl:attribute name="space-before">18pt</xsl:attribute> - </xsl:if> + <xsl:call-template name="sections_element_style"/> <xsl:apply-templates/> </fo:block> </xsl:template> + <xsl:template name="sections_element_style"> + + <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms --> + <xsl:if test="$pos &gt;= 2"> + <xsl:attribute name="space-before">18pt</xsl:attribute> + </xsl:if> + + </xsl:template> <!-- sections_element_style --> + <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* --> <fo:block break-after="page"/> <fo:block> <xsl:call-template name="setId"/> <xsl:apply-templates/> @@ -9571,14 +9918,20 @@ <fo:block> <xsl:call-template name="setId"/> <xsl:call-template name="setBlockSpanAll"/> + <xsl:call-template name="refine_clause_style"/> + <xsl:apply-templates/> </fo:block> </xsl:template> + <xsl:template name="refine_clause_style"> + + </xsl:template> <!-- refine_clause_style --> + <xsl:template match="*[local-name() = 'definitions']"> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> </xsl:template> @@ -9587,14 +9940,20 @@ <fo:block break-after="page"/> <fo:block id="{@id}"> <xsl:call-template name="setBlockSpanAll"/> + <xsl:call-template name="refine_annex_style"/> + </fo:block> <xsl:apply-templates/> </xsl:template> + <xsl:template name="refine_annex_style"> + + </xsl:template> + <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl --> <!-- comment 2019-11-29 --> <!-- <fo:block font-weight="bold">Review:</fo:block> <xsl:apply-templates /> --> @@ -9755,10 +10114,12 @@ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when> <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise> </xsl:choose> </xsl:attribute> + <xsl:call-template name="refine_list_container_style"/> + <fo:block-container margin-left="0mm"> <fo:block> <xsl:apply-templates select="." mode="list"/> </fo:block> </fo:block-container> @@ -9772,21 +10133,25 @@ </xsl:otherwise> </xsl:choose> </xsl:template> + <xsl:template name="refine_list_container_style"> + + </xsl:template> <!-- refine_list_container_style --> + <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list"> <xsl:apply-templates select="*[local-name() = 'name']"> <xsl:with-param name="process">true</xsl:with-param> </xsl:apply-templates> <fo:list-block xsl:use-attribute-sets="list-style"> <xsl:variable name="provisional_distance_between_starts_"> <attributes xsl:use-attribute-sets="list-style"> - + <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/> </attributes> </xsl:variable> <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/> <xsl:if test="$provisional_distance_between_starts != ''"> <xsl:attribute name="provisional-distance-between-starts"><xsl:value-of select="$provisional_distance_between_starts"/></xsl:attribute> @@ -9818,10 +10183,12 @@ <!-- <xsl:copy-of select="$item_numbers"/> <max_length><xsl:value-of select="$max_length"/></max_length> <addon><xsl:value-of select="$addon"/></addon> --> </xsl:if> + <xsl:call-template name="refine_list-style"/> + <xsl:if test="*[local-name() = 'name']"> <xsl:attribute name="margin-top">0pt</xsl:attribute> </xsl:if> <xsl:apply-templates select="node()[not(local-name() = 'note')]"/> @@ -9830,10 +10197,14 @@ <xsl:call-template name="note"/> </xsl:for-each> --> <xsl:apply-templates select="./*[local-name() = 'note']"/> </xsl:template> + <xsl:template name="refine_list-style_provisional-distance-between-starts"> + + </xsl:template> <!-- refine_list-style_provisional-distance-between-starts --> + <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']"> <xsl:param name="process">false</xsl:param> <xsl:if test="$process = 'true'"> <fo:block xsl:use-attribute-sets="list-name-style"> <xsl:apply-templates/> @@ -9843,31 +10214,30 @@ <xsl:template match="*[local-name()='li']"> <fo:list-item xsl:use-attribute-sets="list-item-style"> <xsl:copy-of select="@id"/> + <xsl:call-template name="refine_list-item-style"/> + <fo:list-item-label end-indent="label-end()"> <fo:block xsl:use-attribute-sets="list-item-label-style"> + <xsl:call-template name="refine_list-item-label-style"/> + <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' --> <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]"> <xsl:call-template name="append_add-style"/> </xsl:if> - <xsl:call-template name="getListItemFormat"/> + <xsl:call-template name="getListItemFormat"/> + </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style"> <fo:block> - <xsl:attribute name="margin-bottom">10pt</xsl:attribute> - <xsl:if test="ancestor::ogc:table[not(@class)]"> - <xsl:attribute name="margin-bottom">1mm</xsl:attribute> - </xsl:if> - <xsl:if test="not(following-sibling::*) and not(../following-sibling::*)"> - <xsl:attribute name="margin-bottom">0pt</xsl:attribute> - </xsl:if> + <xsl:call-template name="refine_list-item-body-style"/> <xsl:apply-templates/> <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" /> @@ -10182,10 +10552,11 @@ <!-- Normative references --> <xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2"> <fo:block id="{@id}"> <xsl:apply-templates/> + </fo:block> </xsl:template> <!-- Bibliography (non-normative references) --> <xsl:template match="*[local-name() = 'references']"> @@ -10201,10 +10572,11 @@ </xsl:if> </xsl:if> --> <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style"> <xsl:apply-templates/> + </fo:block> </xsl:template> <!-- references --> <xsl:template match="*[local-name() = 'bibitem']"> @@ -10779,10 +11151,13 @@ <xsl:call-template name="add_id"/> <xsl:apply-templates mode="update_xml_step1"/> </xsl:copy> </xsl:template> + <!-- prevent empty thead processing in XSL-FO, remove it --> + <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/> + <xsl:template name="add_id"> <xsl:if test="not(@id)"> <!-- add @id - first element with @id plus '_element_name' --> <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute> </xsl:if> @@ -11063,10 +11438,18 @@ </fn> --> <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn"> <xsl:variable name="p_fn_"> <xsl:call-template name="get_fn_list"/> + <!-- <xsl:choose> + <xsl:when test="$namespace = 'jis'"> + <xsl:call-template name="get_fn_list_for_element"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="get_fn_list"/> + </xsl:otherwise> + </xsl:choose> --> </xsl:variable> <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/> <xsl:variable name="gen_id" select="generate-id(.)"/> <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/> <xsl:variable name="reference" select="@reference"/> @@ -11077,11 +11460,17 @@ <xsl:apply-templates select="@*" mode="linear_xml"/> <!-- put actual reference number --> <xsl:attribute name="current_fn_number"> <xsl:value-of select="$current_fn_number"/> </xsl:attribute> + <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/> <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote --> - <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/> + + <xsl:value-of select="$skip_footnote_body_"/> + + </xsl:attribute> + <xsl:attribute name="ref_id"> + <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/> </xsl:attribute> <xsl:apply-templates select="node()" mode="linear_xml"/> </xsl:copy> </xsl:template> \ No newline at end of file