lib/isodoc/itu/itu.technical-report.xsl in metanorma-itu-2.1.10 vs lib/isodoc/itu/itu.technical-report.xsl in metanorma-itu-2.1.11
- old
+ new
@@ -393,14 +393,22 @@
<xsl:with-param name="formatted">true</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($tsb_full))"/>
</fo:block>
- <fo:block-container height="20mm" display-align="center">
+ <fo:block-container height="20mm" display-align="center" width="90%">
<fo:block font-weight="bold">
<!-- complements -->
<!-- To do: Example: COMPLEMENT TO ITU-T RECOMMENDATIONS F.69 (06/1994) AND F.68 (11/1988) -->
+ <fo:inline>COMPLEMENT TO ITU-T RECOMMENDATIONS </fo:inline>
+ <xsl:for-each select="/*/itu:bibdata/itu:relation[@type = 'complements']">
+ <xsl:value-of select="translate(itu:bibitem/itu:docidentifier, ' ', ' ')"/>
+ <xsl:choose>
+ <xsl:when test="count(following-sibling::itu:relation[@type = 'complements']) = 1"> AND </xsl:when>
+ <xsl:when test="following-sibling::itu:relation[@type = 'complements']">, </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
</fo:block>
</fo:block-container>
<fo:block-container>
<fo:block font-size="1pt"><fo:leader leader-pattern="rule" leader-length="90%" rule-style="solid" rule-thickness="1pt"/></fo:block>
<fo:block-container height="75mm" display-align="center">
@@ -676,11 +684,11 @@
</fo:table-row>
<fo:table-row height="64mm"> <!-- 59mm -->
<fo:table-cell>
<fo:block> </fo:block>
</fo:table-cell>
- <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" padding-right="2mm" display-align="after">
+ <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" display-align="after">
<fo:block-container>
<xsl:call-template name="setWritingMode"/>
<fo:block padding-bottom="7mm">
<xsl:if test="$doctype = 'resolution'">
<fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting"/></fo:block>
@@ -720,12 +728,22 @@
</xsl:if>
<xsl:value-of select="$meeting-date_to_str"/>
</xsl:if>
</fo:block>
</xsl:if>
+ <xsl:if test="$doctype = 'focus-group'">
+ <xsl:attribute name="padding-bottom">0mm</xsl:attribute>
+ <xsl:attribute name="border-bottom">1pt solid black</xsl:attribute>
+ </xsl:if>
<fo:block text-transform="uppercase">
- <xsl:variable name="series_title" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
+ <xsl:variable name="series_title_full" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
+ <xsl:variable name="series_title">
+ <xsl:value-of select="$series_title_full"/>
+ <xsl:if test="$series_title_full = ''">
+ <xsl:value-of select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type != 'full' and @type != 'abbrev'])"/>
+ </xsl:if>
+ </xsl:variable>
<xsl:if test="$series_title != ''">
<xsl:variable name="title">
<xsl:if test="$doctype != 'resolution'">
<!-- <xsl:text>Series </xsl:text> -->
<xsl:call-template name="getLocalizedString">
@@ -1294,10 +1312,11 @@
</xsl:variable>
<xsl:value-of select="$title-summary"/>
</fo:block>
<xsl:apply-templates/>
</xsl:template>
+ <xsl:template match="itu:itu-standard/itu:preface/itu:abstract[@id = '_summary']/itu:title" priority="4"/>
<xsl:template match="itu:preface/itu:clause" priority="3">
<xsl:if test="$doctype != 'service-publication'">
<fo:block font-size="12pt">
<xsl:value-of select="$linebreak"/>
@@ -3051,12 +3070,10 @@
</xsl:attribute-set> <!-- bibitem-normative-list-style -->
<xsl:attribute-set name="bibitem-non-normative-style">
<xsl:attribute name="margin-top">6pt</xsl:attribute>
- <xsl:attribute name="margin-left">14mm</xsl:attribute>
- <xsl:attribute name="text-indent">-14mm</xsl:attribute>
</xsl:attribute-set> <!-- bibitem-non-normative-style -->
<!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
<xsl:attribute-set name="bibitem-non-normative-list-style">
@@ -5546,12 +5563,21 @@
</xsl:if>
<xsl:apply-templates/>
</fo:inline>
</xsl:template> <!-- tt -->
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
<xsl:template match="*[local-name()='tt']/text()" priority="2">
- <xsl:call-template name="add_spaces_to_sourcecode"/>
+ <xsl:choose>
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
+ <!-- url -->
+ <xsl:call-template name="add-zero-spaces-link-java"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="*[local-name()='underline']">
<fo:inline text-decoration="underline">
<xsl:apply-templates/>
@@ -5903,12 +5929,15 @@
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
</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 -->
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1')"/>
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
</xsl:template>
<!-- add zero space after dash character (for table's entries) -->
<xsl:template name="add-zero-spaces">
<xsl:param name="text" select="."/>
@@ -9709,32 +9738,46 @@
<xsl:if test="$doctype = 'implementers-guide'">
<xsl:attribute name="margin-left">0mm</xsl:attribute>
<xsl:attribute name="text-indent">0mm</xsl:attribute>
</xsl:if>
+ <xsl:variable name="docidentifier_metanorma" select="normalize-space(itu:docidentifier[@type = 'metanorma'])"/>
+ <xsl:variable name="docidentifier_metanorma_ordinal" select="normalize-space(itu:docidentifier[@type = 'metanorma-ordinal'])"/>
+
<xsl:variable name="bibitem_label">
- <xsl:value-of select="itu:docidentifier[@type = 'metanorma']"/>
- <xsl:if test="not(itu:docidentifier[@type = 'metanorma'])">
+ <xsl:value-of select="$docidentifier_metanorma"/>
+ <xsl:if test="$docidentifier_metanorma = ''">
<fo:inline padding-right="5mm">
- <xsl:text>[</xsl:text>
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
- <xsl:text>] </xsl:text>
+ <xsl:variable name="docidentifier" select="normalize-space(itu:docidentifier[not(@type = 'metanorma-ordinal')])"/>
+ <xsl:choose>
+ <xsl:when test="$docidentifier != ''">
+ <xsl:text>[</xsl:text>
+ <xsl:value-of select="$docidentifier"/>
+ <xsl:text>] </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$docidentifier_metanorma_ordinal"/>
+ </xsl:otherwise>
+ </xsl:choose>
</fo:inline>
</xsl:if>
</xsl:variable>
<xsl:variable name="bibitem_body">
- <xsl:text> </xsl:text>
- <xsl:choose>
- <xsl:when test="itu:docidentifier[@type = 'metanorma']">
- <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="itu:formattedref and not(itu:docidentifier[@type = 'metanorma'])">, </xsl:if>
+ <xsl:variable name="docidentifier">
+ <xsl:text> </xsl:text>
+ <xsl:choose>
+ <xsl:when test="$docidentifier_metanorma != ''">
+ <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$docidentifier"/>
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
<xsl:apply-templates select="itu:formattedref"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$doctype = 'implementers-guide'">
@@ -9747,13 +9790,31 @@
<fo:table-cell><fo:block><xsl:copy-of select="$bibitem_body"/></fo:block></fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:when> <!-- $doctype = 'implementers-guide' -->
- <xsl:otherwise>
+ <xsl:when test="$bibitem_label != $docidentifier_metanorma_ordinal">
+ <xsl:attribute name="margin-left">14mm</xsl:attribute>
+ <xsl:attribute name="text-indent">-14mm</xsl:attribute>
<xsl:copy-of select="$bibitem_label"/>
<xsl:copy-of select="$bibitem_body"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:list-block provisional-distance-between-starts="14mm">
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block>
+ <xsl:copy-of select="$bibitem_label"/>
+ </fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>
+ <xsl:copy-of select="$bibitem_body"/>
+ </fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
</xsl:otherwise>
</xsl:choose>
</xsl:template> <!-- processBibitem (bibitem) -->
@@ -10337,10 +10398,10 @@
<xsl:variable name="express_reference_separators">_.\</xsl:variable>
<xsl:variable name="express_reference_characters" select="concat($upper,$lower,'1234567890',$express_reference_separators)"/>
<xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
<!-- enclose standard's number into tag 'keep-together_within-line' -->
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
<xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
<xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable>
\ No newline at end of file