lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-1.5.3 vs lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-1.5.4

- old
+ new

@@ -5,10 +5,12 @@ <xsl:param name="svg_images"/> <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format --> <xsl:variable name="images" select="document($svg_images)"/> <xsl:param name="basepath"/> + <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/> + <xsl:variable name="pageWidth" select="215.9"/> <xsl:variable name="pageHeight" select="279.4"/> <xsl:variable name="marginLeftRight1" select="35"/> <xsl:variable name="marginLeftRight2" select="17"/> <xsl:variable name="marginTop" select="16.5"/> @@ -421,20 +423,20 @@ <fo:block-container line-height="130%"> <fo:block role="TOC"> - <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"> + <xsl:for-each select="xalan:nodeset($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 = 2 and not(@parent = 'annex')"> + <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"> @@ -448,11 +450,14 @@ <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}" fox:alt-text="{text()}"> + <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> @@ -465,12 +470,21 @@ </fo:list-item-body> </fo:list-item> </fo:list-block> </xsl:when> <xsl:otherwise> - <fo:block text-align-last="justify" margin-left="8mm"> - <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}"> + <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"> @@ -501,13 +515,16 @@ <xsl:with-param name="title" select="$title-list-tables"/> </xsl:call-template> </fo:block-container> </fo:block-container> <fo:block-container line-height="130%"> - <xsl:for-each select="//ogc:table[@id and ogc:name]"> <!-- contains(ogc:name, '—') --> + <xsl:for-each select="//ogc:table[@id and ogc:name and normalize-space(@id) != '']"> <!-- contains(ogc:name, '—') --> <fo:block text-align-last="justify" margin-top="2pt" role="TOCI"> - <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}"> + <fo:basic-link internal-destination="{@id}"> + <xsl:call-template name="setAltText"> + <xsl:with-param name="value" select="ogc:name"/> + </xsl:call-template> <xsl:apply-templates select="ogc:name" mode="contents"/> <fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots"/> <fo:page-number-citation ref-id="{@id}"/> </fo:inline> @@ -516,11 +533,11 @@ </xsl:for-each> </fo:block-container> </xsl:if> <xsl:variable name="list_of_figures_"> - <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] | //*[@id and starts-with(ogc:name, 'Figure ')]"> + <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(ogc:name, 'Figure ') and normalize-space(@id) != '']"> <figure id="{@id}" alt-text="{ogc:name}"> <xsl:apply-templates select="ogc:name" mode="contents"/> </figure> </xsl:for-each> </xsl:variable> @@ -543,11 +560,14 @@ <fo:block-container line-height="130%"> <!-- <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] or //*[@id and starts-with(ogc:name, 'Figure ')]"> --> <!-- contains(ogc:name, '—') --> <xsl:for-each select="$list_of_figures/figure"> <!-- contains(ogc:name, '—') --> <fo:block text-align-last="justify" margin-top="2pt" role="TOCI"> - <fo:basic-link internal-destination="{@id}" fox:alt-text="{@alt-text}"> + <fo:basic-link internal-destination="{@id}"> + <xsl:call-template name="setAltText"> + <xsl:with-param name="value" select="@alt-text"/> + </xsl:call-template> <!-- <xsl:apply-templates select="ogc:name" mode="contents"/> --> <xsl:copy-of select="node()"/> <fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots"/> <fo:page-number-citation ref-id="{@id}"/> @@ -574,13 +594,16 @@ </fo:block-container> </fo:block-container> <fo:block-container line-height="130%"> <!-- <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> --> - <xsl:for-each select="xalan:nodeset($toc_recommendations)/*"> + <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}" fox:alt-text="{@alt-text}"> + <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}"/> @@ -756,11 +779,11 @@ </xsl:call-template> </xsl:variable> <xsl:variable name="display"> <xsl:choose> - <xsl:when test="$level &gt;= 3">false</xsl:when> + <xsl:when test="$level &gt; $toc_level">false</xsl:when> <xsl:otherwise>true</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="skip"> @@ -1064,36 +1087,10 @@ <xsl:if test="$inline = 'true'"> <fo:block> </fo:block> </xsl:if> </xsl:template> - <!-- - <fn reference="1"> - <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p> - </fn> - --> - <xsl:template match="ogc:title//ogc:fn | ogc:name//ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)] | ogc:p/*/ogc:fn[not(ancestor::ogc:table)] | ogc:sourcecode/ogc:fn[not(ancestor::ogc:table)]" priority="2" name="fn"> - <fo:footnote keep-with-previous.within-line="always"> - <xsl:variable name="number" select="@reference"/> - - <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> - <fo:basic-link internal-destination="footnote_{@reference}" fox:alt-text="footnote {@reference}"> - <xsl:value-of select="$number"/><!-- + count(//ogc:bibitem/ogc:note) --> - </fo:basic-link> - </fo:inline> - <fo:footnote-body> - <fo:block font-size="10pt" margin-bottom="12pt" font-weight="normal" text-indent="0" start-indent="0" color="{$color_main}" line-height="124%" text-align="justify"> - <fo:inline id="footnote_{@reference}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" --> - <xsl:value-of select="$number "/><!-- + count(//ogc:bibitem/ogc:note) --> - </fo:inline> - <xsl:for-each select="ogc:p"> - <xsl:apply-templates/> - </xsl:for-each> - </fo:block> - </fo:footnote-body> - </fo:footnote> - </xsl:template> <xsl:template match="ogc:fn/ogc:p"> <fo:block> <xsl:apply-templates/> </fo:block> @@ -2302,10 +2299,84 @@ </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-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> + + + + + + + + + + + + + + <xsl:attribute name="font-size">65%</xsl:attribute> + <xsl:attribute name="vertical-align">super</xsl:attribute> + + + + + </xsl:attribute-set><xsl:attribute-set name="fn-body-style"> + <xsl:attribute name="font-weight">normal</xsl:attribute> + <xsl:attribute name="font-style">normal</xsl:attribute> + <xsl:attribute name="text-indent">0</xsl:attribute> + <xsl:attribute name="start-indent">0</xsl:attribute> + + + + + + + + + + + + + + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute> + <xsl:attribute name="line-height">124%</xsl:attribute> + <xsl:attribute name="text-align">justify</xsl:attribute> + + + + + + </xsl:attribute-set><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><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="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"/> @@ -3269,10 +3340,106 @@ <xsl:apply-templates 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"> + + <!-- list of footnotes to calculate actual footnotes number --> + <xsl:variable name="p_fn_"> + <xsl:choose> + <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already --> + <fn gen_id="{generate-id(.)}"> + <xsl:copy-of select="@*"/> + <xsl:copy-of select="node()"/> + </fn> + </xsl:when> + <xsl:otherwise> + <!-- itetation for: + footnotes in bibdata/title + footnotes in bibliography + footnotes in document's body (except table's head/body/foot and figure text) + --> + <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']"> + <fn gen_id="{generate-id(.)}"> + <xsl:copy-of select="@*"/> + <xsl:copy-of select="node()"/> + </fn> + </xsl:for-each> + <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*"> + <xsl:sort select="@displayorder" data-type="number"/> + <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][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: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"/> + <!-- fn sequence number in document --> + <xsl:variable name="current_fn_number"> + <xsl:choose> + <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI --> + <xsl:otherwise> + <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <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="footnote_inline"> + <fo:inline xsl:use-attribute-sets="fn-num-style"> + + <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> + <xsl:value-of select="$current_fn_number_text"/> + </fo:basic-link> + </fo:inline> + </xsl:variable> + <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/> + gen_id=<xsl:value-of select="$gen_id"/> --> + <xsl:choose> + <xsl:when test="normalize-space(@skip_footnote_body) = 'true'"> + <xsl:copy-of select="$footnote_inline"/> + </xsl:when> + <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 xsl:use-attribute-sets="fn-body-style"> + + + <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style"> + + <xsl:value-of select="$current_fn_number_text"/> + </fo:inline> + <xsl:apply-templates/> + </fo:block> + </fo:block-container> + </fo:footnote-body> + </fo:footnote> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$footnote_inline"/> + </xsl:otherwise> + </xsl:choose> </xsl:template><xsl:template name="fn_display"> <xsl:variable name="references"> <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']"> <xsl:call-template name="create_fn"/> @@ -3474,10 +3641,12 @@ <xsl:value-of select="@reference"/> </fo:basic-link> </fo:inline> + </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']"> + <fo:inline><xsl:value-of select="."/></fo:inline> </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']"> <fo:inline> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name()='dl']"> @@ -4469,26 +4638,10 @@ <fo:inline id="{@id}"> <!-- for first p in annotation, put <x> --> <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() = 'modification']"> - <xsl:variable name="title-modified"> - - - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-modified'"/> - </xsl:call-template> - - </xsl:variable> - - <xsl:variable name="text"><xsl:apply-templates/></xsl:variable> - <xsl:choose> - <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when> - <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise> - </xsl:choose> - <xsl:apply-templates/> </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> @@ -5818,63 +5971,75 @@ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] --> <xsl:variable name="termsource_text"> <xsl:apply-templates/> </xsl:variable> - - <xsl:choose> + <xsl:copy-of select="$termsource_text"/> + <!-- <xsl:choose> <xsl:when test="starts-with(normalize-space($termsource_text), '[')"> - <!-- <xsl:apply-templates /> --> <xsl:copy-of select="$termsource_text"/> </xsl:when> <xsl:otherwise> - - - <!-- <xsl:apply-templates /> --> + <xsl:if test="$namespace = 'bsi'"> + <xsl:choose> + <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when> + <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise> + </xsl:choose> + </xsl:if> + <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'"> + <xsl:text>[</xsl:text> + </xsl:if> <xsl:copy-of select="$termsource_text"/> - - + <xsl:if test="$namespace = 'bsi'"> + <xsl:choose> + <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when> + <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise> + </xsl:choose> + </xsl:if> + <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'"> + <xsl:text>]</xsl:text> + </xsl:if> </xsl:otherwise> - </xsl:choose> + </xsl:choose> --> </fo:block> </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()"> <xsl:if test="normalize-space() != ''"> <xsl:value-of select="."/> </xsl:if> - </xsl:template><xsl:variable name="localized.source"> - <xsl:call-template name="getLocalizedString"> - <xsl:with-param name="key">source</xsl:with-param> - </xsl:call-template> - </xsl:variable><xsl:template match="*[local-name() = 'origin']"> + </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()"> + <fo:inline> + + + <xsl:attribute name="padding-right">1mm</xsl:attribute> + + <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) = ''"> <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute> </xsl:if> - - <xsl:text>[</xsl:text> - <fo:inline> - - <xsl:attribute name="font-weight">bold</xsl:attribute> - <xsl:attribute name="padding-right">1mm</xsl:attribute> - - - - - - <xsl:value-of select="$localized.source"/> - <xsl:text>: </xsl:text> - - - - - </fo:inline> - <fo:inline xsl:use-attribute-sets="origin-style"> <xsl:apply-templates/> </fo:inline> - <xsl:text>]</xsl:text> - </fo:basic-link> + </fo:basic-link> + </xsl:template><xsl:template match="*[local-name() = 'modification']"> + <xsl:variable name="title-modified"> + + + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-modified'"/> + </xsl:call-template> + + </xsl:variable> + + <xsl:variable name="text"><xsl:apply-templates/></xsl:variable> + <xsl:choose> + <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when> + <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise> + </xsl:choose> + <xsl:apply-templates/> </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']"> <fo:inline><xsl:apply-templates/></fo:inline> </xsl:template><xsl:template match="*[local-name() = 'modification']/text()"> <xsl:if test="normalize-space() != ''"> <xsl:value-of select="."/> @@ -6616,11 +6781,35 @@ </fo:inline> </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']"> <fo:block-container border="1pt solid black" width="50%"> <fo:block> </fo:block> </fo:block-container> - </xsl:template><xsl:template match="*[local-name() = 'toc']"> + </xsl:template><xsl:variable name="toc_level"> + <xsl:choose> + <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml --> + <xsl:otherwise><!-- default value --> + + + + + + + + + + + + + + 2 + + + + + </xsl:otherwise> + </xsl:choose> + </xsl:variable><xsl:template match="*[local-name() = 'toc']"> <xsl:param name="colwidths"/> <xsl:variable name="colwidths_"> <xsl:choose> <xsl:when test="not($colwidths)"> <xsl:variable name="toc_table_simple"> @@ -7256,6 +7445,16 @@ <xsl:otherwise> <xsl:value-of select="$value"/> </xsl:otherwise> </xsl:choose> </xsl:if> + </xsl:template><xsl:template name="setAltText"> + <xsl:param name="value"/> + <xsl:attribute name="fox:alt-text"> + <xsl:choose> + <xsl:when test="normalize-space($value) != ''"> + <xsl:value-of select="$value"/> + </xsl:when> + <xsl:otherwise>_</xsl:otherwise> + </xsl:choose> + </xsl:attribute> </xsl:template></xsl:stylesheet> \ No newline at end of file