lib/isodoc/itu/itu.recommendation-supplement.xsl in metanorma-itu-2.2.14 vs lib/isodoc/itu/itu.recommendation-supplement.xsl in metanorma-itu-2.2.15

- old
+ new

@@ -2278,24 +2278,37 @@ - there is a difference between localized string value and text that should be displayed in PDF --> <xsl:variable name="titles_"> <!-- These titles of Table of contents renders different than determined in localized-strings --> - <title-toc lang="en"> - - </title-toc> - <title-toc lang="fr"> + <!-- <title-toc lang="en"> + <xsl:if test="$namespace = 'csd' or $namespace = 'ieee' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'unece-rec'"> + <xsl:text>Contents</xsl:text> + </xsl:if> + <xsl:if test="$namespace = 'csa' or $namespace = 'm3d' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper'"> + <xsl:text>Table of Contents</xsl:text> + </xsl:if> + <xsl:if test="$namespace = 'gb'"> + <xsl:text>Table of contents</xsl:text> + </xsl:if> + </title-toc> --> + <title-toc lang="en">Table of contents</title-toc> + <!-- <title-toc lang="fr"> <xsl:text>Sommaire</xsl:text> - </title-toc> - <title-toc lang="zh"> - + </title-toc> --> + <!-- <title-toc lang="zh"> + <xsl:choose> + <xsl:when test="$namespace = 'gb'"> + <xsl:text>目次</xsl:text> + </xsl:when> + <xsl:otherwise> <xsl:text>Contents</xsl:text> + </xsl:otherwise> + </xsl:choose> + </title-toc> --> + <title-toc lang="zh">目次</title-toc> - </title-toc> - - <title-descriptors lang="en">Descriptors</title-descriptors> - <title-part lang="en"> </title-part> <title-part lang="fr"> @@ -2306,53 +2319,39 @@ <title-part lang="zh">第 # 部分:</title-part> <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> - - <title-table-figures lang="en">Table of Figures</title-table-figures> - - <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations> - - <title-summary lang="en">Summary</title-summary> - - <title-continued lang="ru">(продолжение)</title-continued> - <title-continued lang="en">(continued)</title-continued> - <title-continued lang="fr">(continué)</title-continued> - </xsl:variable> <xsl:variable name="titles" select="xalan:nodeset($titles_)"/> <xsl:variable name="title-list-tables"> <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/> <xsl:value-of select="$toc_table_title"/> <xsl:if test="normalize-space($toc_table_title) = ''"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-list-tables'"/> + <xsl:call-template name="getLocalizedString"> + <xsl:with-param name="key">toc_tables</xsl:with-param> </xsl:call-template> </xsl:if> </xsl:variable> <xsl:variable name="title-list-figures"> <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/> <xsl:value-of select="$toc_figure_title"/> <xsl:if test="normalize-space($toc_figure_title) = ''"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-list-figures'"/> + <xsl:call-template name="getLocalizedString"> + <xsl:with-param name="key">toc_figures</xsl:with-param> </xsl:call-template> </xsl:if> </xsl:variable> <xsl:variable name="title-list-recommendations"> <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/> <xsl:value-of select="$toc_requirement_title"/> <xsl:if test="normalize-space($toc_requirement_title) = ''"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-list-recommendations'"/> + <xsl:call-template name="getLocalizedString"> + <xsl:with-param name="key">toc_recommendations</xsl:with-param> </xsl:call-template> </xsl:if> </xsl:variable> <xsl:variable name="bibdata"> @@ -6192,11 +6191,11 @@ </xsl:template> <!-- tt --> <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable> <xsl:template match="*[local-name()='tt']/text()" priority="2"> <xsl:choose> - <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''"> + <xsl:when test="java:replaceAll(java:java.lang.String.new(.), $regex_url_start, '$2') != ''"> <!-- url --> <xsl:call-template name="add-zero-spaces-link-java"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="add_spaces_to_sourcecode"/> @@ -6654,25 +6653,32 @@ </xsl:when> <xsl:otherwise><xsl:value-of select="$text8"/></xsl:otherwise> </xsl:choose> </xsl:variable> + <!-- replace sequence #x200B to one &#x200B --> + <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b{2,}', '​')"/> + <!-- replace sequence #x200B and space TO space --> - <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/> + <xsl:variable name="text11" select="java:replaceAll(java:java.lang.String.new($text10), '\u200b ', ' ')"/> - <xsl:value-of select="$text10"/> + <xsl:value-of select="$text11"/> </xsl:template> <xsl:template name="add-zero-spaces-link-java"> <xsl:param name="text" select="."/> <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. --> <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/> <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, comma, slash, @ --> <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/|@)','$1​')"/> + + <!-- replace sequence #x200B to one &#x200B --> + <xsl:variable name="url2" select="java:replaceAll(java:java.lang.String.new($url), '\u200b{2,}', '​')"/> + <!-- remove zero-width space at the end --> - <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/> + <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url2), '​$', '')"/> </xsl:template> <!-- add zero space after dash character (for table's entries) --> <xsl:template name="add-zero-spaces"> <xsl:param name="text" select="."/> @@ -7931,11 +7937,11 @@ <fo:block> <xsl:call-template name="refine_note_block_style"/> - <fo:inline xsl:use-attribute-sets="note-name-style"> + <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP"> <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']]"> --> @@ -7972,15 +7978,15 @@ <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"> + <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP"> <xsl:apply-templates/> </fo:inline> </xsl:when> <xsl:otherwise> - <fo:block xsl:use-attribute-sets="note-p-style"> + <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP"> <xsl:apply-templates/> </fo:block> </xsl:otherwise> </xsl:choose> </xsl:template> \ No newline at end of file