metanorma-itu 2.1.10 → 2.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -395,10 +395,18 @@
395
395
  </xsl:variable>
396
396
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($tsb_full))"/>
397
397
  </fo:block>
398
- <fo:block-container height="20mm" display-align="center">
398
+ <fo:block-container height="20mm" display-align="center" width="90%">
399
399
  <fo:block font-weight="bold">
400
400
  <!-- complements -->
401
401
  <!-- To do: Example: COMPLEMENT TO ITU-T RECOMMENDATIONS F.69 (06/1994) AND F.68 (11/1988) -->
402
+ <fo:inline>COMPLEMENT TO ITU-T RECOMMENDATIONS </fo:inline>
403
+ <xsl:for-each select="/*/itu:bibdata/itu:relation[@type = 'complements']">
404
+ <xsl:value-of select="translate(itu:bibitem/itu:docidentifier, ' ', ' ')"/>
405
+ <xsl:choose>
406
+ <xsl:when test="count(following-sibling::itu:relation[@type = 'complements']) = 1"> AND </xsl:when>
407
+ <xsl:when test="following-sibling::itu:relation[@type = 'complements']">, </xsl:when>
408
+ </xsl:choose>
409
+ </xsl:for-each>
402
410
  </fo:block>
403
411
  </fo:block-container>
404
412
  <fo:block-container>
@@ -678,7 +686,7 @@
678
686
  <fo:table-cell>
679
687
  <fo:block> </fo:block>
680
688
  </fo:table-cell>
681
- <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" padding-right="2mm" display-align="after">
689
+ <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" display-align="after">
682
690
  <fo:block-container>
683
691
  <xsl:call-template name="setWritingMode"/>
684
692
  <fo:block padding-bottom="7mm">
@@ -722,8 +730,18 @@
722
730
  </xsl:if>
723
731
  </fo:block>
724
732
  </xsl:if>
733
+ <xsl:if test="$doctype = 'focus-group'">
734
+ <xsl:attribute name="padding-bottom">0mm</xsl:attribute>
735
+ <xsl:attribute name="border-bottom">1pt solid black</xsl:attribute>
736
+ </xsl:if>
725
737
  <fo:block text-transform="uppercase">
726
- <xsl:variable name="series_title" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
738
+ <xsl:variable name="series_title_full" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
739
+ <xsl:variable name="series_title">
740
+ <xsl:value-of select="$series_title_full"/>
741
+ <xsl:if test="$series_title_full = ''">
742
+ <xsl:value-of select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type != 'full' and @type != 'abbrev'])"/>
743
+ </xsl:if>
744
+ </xsl:variable>
727
745
  <xsl:if test="$series_title != ''">
728
746
  <xsl:variable name="title">
729
747
  <xsl:if test="$doctype != 'resolution'">
@@ -1296,6 +1314,7 @@
1296
1314
  </fo:block>
1297
1315
  <xsl:apply-templates/>
1298
1316
  </xsl:template>
1317
+ <xsl:template match="itu:itu-standard/itu:preface/itu:abstract[@id = '_summary']/itu:title" priority="4"/>
1299
1318
 
1300
1319
  <xsl:template match="itu:preface/itu:clause" priority="3">
1301
1320
  <xsl:if test="$doctype != 'service-publication'">
@@ -3053,8 +3072,6 @@
3053
3072
  <xsl:attribute-set name="bibitem-non-normative-style">
3054
3073
 
3055
3074
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
3056
- <xsl:attribute name="margin-left">14mm</xsl:attribute>
3057
- <xsl:attribute name="text-indent">-14mm</xsl:attribute>
3058
3075
 
3059
3076
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
3060
3077
 
@@ -5548,8 +5565,17 @@
5548
5565
  </fo:inline>
5549
5566
  </xsl:template> <!-- tt -->
5550
5567
 
5568
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
5551
5569
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
5552
- <xsl:call-template name="add_spaces_to_sourcecode"/>
5570
+ <xsl:choose>
5571
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
5572
+ <!-- url -->
5573
+ <xsl:call-template name="add-zero-spaces-link-java"/>
5574
+ </xsl:when>
5575
+ <xsl:otherwise>
5576
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5577
+ </xsl:otherwise>
5578
+ </xsl:choose>
5553
5579
  </xsl:template>
5554
5580
 
5555
5581
  <xsl:template match="*[local-name()='underline']">
@@ -5905,8 +5931,11 @@
5905
5931
 
5906
5932
  <xsl:template name="add-zero-spaces-link-java">
5907
5933
  <xsl:param name="text" select="."/>
5934
+
5935
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
5936
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5908
5937
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
5909
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
5938
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
5910
5939
  </xsl:template>
5911
5940
 
5912
5941
  <!-- add zero space after dash character (for table's entries) -->
@@ -9711,28 +9740,42 @@
9711
9740
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
9712
9741
  </xsl:if>
9713
9742
 
9743
+ <xsl:variable name="docidentifier_metanorma" select="normalize-space(itu:docidentifier[@type = 'metanorma'])"/>
9744
+ <xsl:variable name="docidentifier_metanorma_ordinal" select="normalize-space(itu:docidentifier[@type = 'metanorma-ordinal'])"/>
9745
+
9714
9746
  <xsl:variable name="bibitem_label">
9715
- <xsl:value-of select="itu:docidentifier[@type = 'metanorma']"/>
9716
- <xsl:if test="not(itu:docidentifier[@type = 'metanorma'])">
9747
+ <xsl:value-of select="$docidentifier_metanorma"/>
9748
+ <xsl:if test="$docidentifier_metanorma = ''">
9717
9749
  <fo:inline padding-right="5mm">
9718
- <xsl:text>[</xsl:text>
9719
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9720
- <xsl:text>] </xsl:text>
9750
+ <xsl:variable name="docidentifier" select="normalize-space(itu:docidentifier[not(@type = 'metanorma-ordinal')])"/>
9751
+ <xsl:choose>
9752
+ <xsl:when test="$docidentifier != ''">
9753
+ <xsl:text>[</xsl:text>
9754
+ <xsl:value-of select="$docidentifier"/>
9755
+ <xsl:text>] </xsl:text>
9756
+ </xsl:when>
9757
+ <xsl:otherwise>
9758
+ <xsl:value-of select="$docidentifier_metanorma_ordinal"/>
9759
+ </xsl:otherwise>
9760
+ </xsl:choose>
9721
9761
  </fo:inline>
9722
9762
  </xsl:if>
9723
9763
  </xsl:variable>
9724
9764
 
9725
9765
  <xsl:variable name="bibitem_body">
9726
- <xsl:text> </xsl:text>
9727
- <xsl:choose>
9728
- <xsl:when test="itu:docidentifier[@type = 'metanorma']">
9729
- <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
9730
- </xsl:when>
9731
- <xsl:otherwise>
9732
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9733
- </xsl:otherwise>
9734
- </xsl:choose>
9735
- <xsl:if test="itu:formattedref and not(itu:docidentifier[@type = 'metanorma'])">, </xsl:if>
9766
+ <xsl:variable name="docidentifier">
9767
+ <xsl:text> </xsl:text>
9768
+ <xsl:choose>
9769
+ <xsl:when test="$docidentifier_metanorma != ''">
9770
+ <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
9771
+ </xsl:when>
9772
+ <xsl:otherwise>
9773
+ <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9774
+ </xsl:otherwise>
9775
+ </xsl:choose>
9776
+ </xsl:variable>
9777
+ <xsl:value-of select="$docidentifier"/>
9778
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
9736
9779
  <xsl:apply-templates select="itu:formattedref"/>
9737
9780
  </xsl:variable>
9738
9781
 
@@ -9749,9 +9792,27 @@
9749
9792
  </fo:table-body>
9750
9793
  </fo:table>
9751
9794
  </xsl:when> <!-- $doctype = 'implementers-guide' -->
9752
- <xsl:otherwise>
9795
+ <xsl:when test="$bibitem_label != $docidentifier_metanorma_ordinal">
9796
+ <xsl:attribute name="margin-left">14mm</xsl:attribute>
9797
+ <xsl:attribute name="text-indent">-14mm</xsl:attribute>
9753
9798
  <xsl:copy-of select="$bibitem_label"/>
9754
9799
  <xsl:copy-of select="$bibitem_body"/>
9800
+ </xsl:when>
9801
+ <xsl:otherwise>
9802
+ <fo:list-block provisional-distance-between-starts="14mm">
9803
+ <fo:list-item>
9804
+ <fo:list-item-label end-indent="label-end()">
9805
+ <fo:block>
9806
+ <xsl:copy-of select="$bibitem_label"/>
9807
+ </fo:block>
9808
+ </fo:list-item-label>
9809
+ <fo:list-item-body start-indent="body-start()">
9810
+ <fo:block>
9811
+ <xsl:copy-of select="$bibitem_body"/>
9812
+ </fo:block>
9813
+ </fo:list-item-body>
9814
+ </fo:list-item>
9815
+ </fo:list-block>
9755
9816
  </xsl:otherwise>
9756
9817
  </xsl:choose>
9757
9818
 
@@ -10339,7 +10400,7 @@
10339
10400
 
10340
10401
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
10341
10402
 
10342
- <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">
10403
+ <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">
10343
10404
 
10344
10405
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
10345
10406
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -395,10 +395,18 @@
395
395
  </xsl:variable>
396
396
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($tsb_full))"/>
397
397
  </fo:block>
398
- <fo:block-container height="20mm" display-align="center">
398
+ <fo:block-container height="20mm" display-align="center" width="90%">
399
399
  <fo:block font-weight="bold">
400
400
  <!-- complements -->
401
401
  <!-- To do: Example: COMPLEMENT TO ITU-T RECOMMENDATIONS F.69 (06/1994) AND F.68 (11/1988) -->
402
+ <fo:inline>COMPLEMENT TO ITU-T RECOMMENDATIONS </fo:inline>
403
+ <xsl:for-each select="/*/itu:bibdata/itu:relation[@type = 'complements']">
404
+ <xsl:value-of select="translate(itu:bibitem/itu:docidentifier, ' ', ' ')"/>
405
+ <xsl:choose>
406
+ <xsl:when test="count(following-sibling::itu:relation[@type = 'complements']) = 1"> AND </xsl:when>
407
+ <xsl:when test="following-sibling::itu:relation[@type = 'complements']">, </xsl:when>
408
+ </xsl:choose>
409
+ </xsl:for-each>
402
410
  </fo:block>
403
411
  </fo:block-container>
404
412
  <fo:block-container>
@@ -678,7 +686,7 @@
678
686
  <fo:table-cell>
679
687
  <fo:block> </fo:block>
680
688
  </fo:table-cell>
681
- <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" padding-right="2mm" display-align="after">
689
+ <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" display-align="after">
682
690
  <fo:block-container>
683
691
  <xsl:call-template name="setWritingMode"/>
684
692
  <fo:block padding-bottom="7mm">
@@ -722,8 +730,18 @@
722
730
  </xsl:if>
723
731
  </fo:block>
724
732
  </xsl:if>
733
+ <xsl:if test="$doctype = 'focus-group'">
734
+ <xsl:attribute name="padding-bottom">0mm</xsl:attribute>
735
+ <xsl:attribute name="border-bottom">1pt solid black</xsl:attribute>
736
+ </xsl:if>
725
737
  <fo:block text-transform="uppercase">
726
- <xsl:variable name="series_title" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
738
+ <xsl:variable name="series_title_full" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
739
+ <xsl:variable name="series_title">
740
+ <xsl:value-of select="$series_title_full"/>
741
+ <xsl:if test="$series_title_full = ''">
742
+ <xsl:value-of select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type != 'full' and @type != 'abbrev'])"/>
743
+ </xsl:if>
744
+ </xsl:variable>
727
745
  <xsl:if test="$series_title != ''">
728
746
  <xsl:variable name="title">
729
747
  <xsl:if test="$doctype != 'resolution'">
@@ -1296,6 +1314,7 @@
1296
1314
  </fo:block>
1297
1315
  <xsl:apply-templates/>
1298
1316
  </xsl:template>
1317
+ <xsl:template match="itu:itu-standard/itu:preface/itu:abstract[@id = '_summary']/itu:title" priority="4"/>
1299
1318
 
1300
1319
  <xsl:template match="itu:preface/itu:clause" priority="3">
1301
1320
  <xsl:if test="$doctype != 'service-publication'">
@@ -3053,8 +3072,6 @@
3053
3072
  <xsl:attribute-set name="bibitem-non-normative-style">
3054
3073
 
3055
3074
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
3056
- <xsl:attribute name="margin-left">14mm</xsl:attribute>
3057
- <xsl:attribute name="text-indent">-14mm</xsl:attribute>
3058
3075
 
3059
3076
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
3060
3077
 
@@ -5548,8 +5565,17 @@
5548
5565
  </fo:inline>
5549
5566
  </xsl:template> <!-- tt -->
5550
5567
 
5568
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
5551
5569
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
5552
- <xsl:call-template name="add_spaces_to_sourcecode"/>
5570
+ <xsl:choose>
5571
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
5572
+ <!-- url -->
5573
+ <xsl:call-template name="add-zero-spaces-link-java"/>
5574
+ </xsl:when>
5575
+ <xsl:otherwise>
5576
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5577
+ </xsl:otherwise>
5578
+ </xsl:choose>
5553
5579
  </xsl:template>
5554
5580
 
5555
5581
  <xsl:template match="*[local-name()='underline']">
@@ -5905,8 +5931,11 @@
5905
5931
 
5906
5932
  <xsl:template name="add-zero-spaces-link-java">
5907
5933
  <xsl:param name="text" select="."/>
5934
+
5935
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
5936
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5908
5937
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
5909
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
5938
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
5910
5939
  </xsl:template>
5911
5940
 
5912
5941
  <!-- add zero space after dash character (for table's entries) -->
@@ -9711,28 +9740,42 @@
9711
9740
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
9712
9741
  </xsl:if>
9713
9742
 
9743
+ <xsl:variable name="docidentifier_metanorma" select="normalize-space(itu:docidentifier[@type = 'metanorma'])"/>
9744
+ <xsl:variable name="docidentifier_metanorma_ordinal" select="normalize-space(itu:docidentifier[@type = 'metanorma-ordinal'])"/>
9745
+
9714
9746
  <xsl:variable name="bibitem_label">
9715
- <xsl:value-of select="itu:docidentifier[@type = 'metanorma']"/>
9716
- <xsl:if test="not(itu:docidentifier[@type = 'metanorma'])">
9747
+ <xsl:value-of select="$docidentifier_metanorma"/>
9748
+ <xsl:if test="$docidentifier_metanorma = ''">
9717
9749
  <fo:inline padding-right="5mm">
9718
- <xsl:text>[</xsl:text>
9719
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9720
- <xsl:text>] </xsl:text>
9750
+ <xsl:variable name="docidentifier" select="normalize-space(itu:docidentifier[not(@type = 'metanorma-ordinal')])"/>
9751
+ <xsl:choose>
9752
+ <xsl:when test="$docidentifier != ''">
9753
+ <xsl:text>[</xsl:text>
9754
+ <xsl:value-of select="$docidentifier"/>
9755
+ <xsl:text>] </xsl:text>
9756
+ </xsl:when>
9757
+ <xsl:otherwise>
9758
+ <xsl:value-of select="$docidentifier_metanorma_ordinal"/>
9759
+ </xsl:otherwise>
9760
+ </xsl:choose>
9721
9761
  </fo:inline>
9722
9762
  </xsl:if>
9723
9763
  </xsl:variable>
9724
9764
 
9725
9765
  <xsl:variable name="bibitem_body">
9726
- <xsl:text> </xsl:text>
9727
- <xsl:choose>
9728
- <xsl:when test="itu:docidentifier[@type = 'metanorma']">
9729
- <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
9730
- </xsl:when>
9731
- <xsl:otherwise>
9732
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9733
- </xsl:otherwise>
9734
- </xsl:choose>
9735
- <xsl:if test="itu:formattedref and not(itu:docidentifier[@type = 'metanorma'])">, </xsl:if>
9766
+ <xsl:variable name="docidentifier">
9767
+ <xsl:text> </xsl:text>
9768
+ <xsl:choose>
9769
+ <xsl:when test="$docidentifier_metanorma != ''">
9770
+ <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
9771
+ </xsl:when>
9772
+ <xsl:otherwise>
9773
+ <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9774
+ </xsl:otherwise>
9775
+ </xsl:choose>
9776
+ </xsl:variable>
9777
+ <xsl:value-of select="$docidentifier"/>
9778
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
9736
9779
  <xsl:apply-templates select="itu:formattedref"/>
9737
9780
  </xsl:variable>
9738
9781
 
@@ -9749,9 +9792,27 @@
9749
9792
  </fo:table-body>
9750
9793
  </fo:table>
9751
9794
  </xsl:when> <!-- $doctype = 'implementers-guide' -->
9752
- <xsl:otherwise>
9795
+ <xsl:when test="$bibitem_label != $docidentifier_metanorma_ordinal">
9796
+ <xsl:attribute name="margin-left">14mm</xsl:attribute>
9797
+ <xsl:attribute name="text-indent">-14mm</xsl:attribute>
9753
9798
  <xsl:copy-of select="$bibitem_label"/>
9754
9799
  <xsl:copy-of select="$bibitem_body"/>
9800
+ </xsl:when>
9801
+ <xsl:otherwise>
9802
+ <fo:list-block provisional-distance-between-starts="14mm">
9803
+ <fo:list-item>
9804
+ <fo:list-item-label end-indent="label-end()">
9805
+ <fo:block>
9806
+ <xsl:copy-of select="$bibitem_label"/>
9807
+ </fo:block>
9808
+ </fo:list-item-label>
9809
+ <fo:list-item-body start-indent="body-start()">
9810
+ <fo:block>
9811
+ <xsl:copy-of select="$bibitem_body"/>
9812
+ </fo:block>
9813
+ </fo:list-item-body>
9814
+ </fo:list-item>
9815
+ </fo:list-block>
9755
9816
  </xsl:otherwise>
9756
9817
  </xsl:choose>
9757
9818
 
@@ -10339,7 +10400,7 @@
10339
10400
 
10340
10401
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
10341
10402
 
10342
- <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">
10403
+ <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">
10343
10404
 
10344
10405
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
10345
10406
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -395,10 +395,18 @@
395
395
  </xsl:variable>
396
396
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($tsb_full))"/>
397
397
  </fo:block>
398
- <fo:block-container height="20mm" display-align="center">
398
+ <fo:block-container height="20mm" display-align="center" width="90%">
399
399
  <fo:block font-weight="bold">
400
400
  <!-- complements -->
401
401
  <!-- To do: Example: COMPLEMENT TO ITU-T RECOMMENDATIONS F.69 (06/1994) AND F.68 (11/1988) -->
402
+ <fo:inline>COMPLEMENT TO ITU-T RECOMMENDATIONS </fo:inline>
403
+ <xsl:for-each select="/*/itu:bibdata/itu:relation[@type = 'complements']">
404
+ <xsl:value-of select="translate(itu:bibitem/itu:docidentifier, ' ', ' ')"/>
405
+ <xsl:choose>
406
+ <xsl:when test="count(following-sibling::itu:relation[@type = 'complements']) = 1"> AND </xsl:when>
407
+ <xsl:when test="following-sibling::itu:relation[@type = 'complements']">, </xsl:when>
408
+ </xsl:choose>
409
+ </xsl:for-each>
402
410
  </fo:block>
403
411
  </fo:block-container>
404
412
  <fo:block-container>
@@ -678,7 +686,7 @@
678
686
  <fo:table-cell>
679
687
  <fo:block> </fo:block>
680
688
  </fo:table-cell>
681
- <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" padding-right="2mm" display-align="after">
689
+ <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" display-align="after">
682
690
  <fo:block-container>
683
691
  <xsl:call-template name="setWritingMode"/>
684
692
  <fo:block padding-bottom="7mm">
@@ -722,8 +730,18 @@
722
730
  </xsl:if>
723
731
  </fo:block>
724
732
  </xsl:if>
733
+ <xsl:if test="$doctype = 'focus-group'">
734
+ <xsl:attribute name="padding-bottom">0mm</xsl:attribute>
735
+ <xsl:attribute name="border-bottom">1pt solid black</xsl:attribute>
736
+ </xsl:if>
725
737
  <fo:block text-transform="uppercase">
726
- <xsl:variable name="series_title" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
738
+ <xsl:variable name="series_title_full" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
739
+ <xsl:variable name="series_title">
740
+ <xsl:value-of select="$series_title_full"/>
741
+ <xsl:if test="$series_title_full = ''">
742
+ <xsl:value-of select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type != 'full' and @type != 'abbrev'])"/>
743
+ </xsl:if>
744
+ </xsl:variable>
727
745
  <xsl:if test="$series_title != ''">
728
746
  <xsl:variable name="title">
729
747
  <xsl:if test="$doctype != 'resolution'">
@@ -1296,6 +1314,7 @@
1296
1314
  </fo:block>
1297
1315
  <xsl:apply-templates/>
1298
1316
  </xsl:template>
1317
+ <xsl:template match="itu:itu-standard/itu:preface/itu:abstract[@id = '_summary']/itu:title" priority="4"/>
1299
1318
 
1300
1319
  <xsl:template match="itu:preface/itu:clause" priority="3">
1301
1320
  <xsl:if test="$doctype != 'service-publication'">
@@ -3053,8 +3072,6 @@
3053
3072
  <xsl:attribute-set name="bibitem-non-normative-style">
3054
3073
 
3055
3074
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
3056
- <xsl:attribute name="margin-left">14mm</xsl:attribute>
3057
- <xsl:attribute name="text-indent">-14mm</xsl:attribute>
3058
3075
 
3059
3076
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
3060
3077
 
@@ -5548,8 +5565,17 @@
5548
5565
  </fo:inline>
5549
5566
  </xsl:template> <!-- tt -->
5550
5567
 
5568
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
5551
5569
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
5552
- <xsl:call-template name="add_spaces_to_sourcecode"/>
5570
+ <xsl:choose>
5571
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
5572
+ <!-- url -->
5573
+ <xsl:call-template name="add-zero-spaces-link-java"/>
5574
+ </xsl:when>
5575
+ <xsl:otherwise>
5576
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
5577
+ </xsl:otherwise>
5578
+ </xsl:choose>
5553
5579
  </xsl:template>
5554
5580
 
5555
5581
  <xsl:template match="*[local-name()='underline']">
@@ -5905,8 +5931,11 @@
5905
5931
 
5906
5932
  <xsl:template name="add-zero-spaces-link-java">
5907
5933
  <xsl:param name="text" select="."/>
5934
+
5935
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
5936
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5908
5937
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
5909
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
5938
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
5910
5939
  </xsl:template>
5911
5940
 
5912
5941
  <!-- add zero space after dash character (for table's entries) -->
@@ -9711,28 +9740,42 @@
9711
9740
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
9712
9741
  </xsl:if>
9713
9742
 
9743
+ <xsl:variable name="docidentifier_metanorma" select="normalize-space(itu:docidentifier[@type = 'metanorma'])"/>
9744
+ <xsl:variable name="docidentifier_metanorma_ordinal" select="normalize-space(itu:docidentifier[@type = 'metanorma-ordinal'])"/>
9745
+
9714
9746
  <xsl:variable name="bibitem_label">
9715
- <xsl:value-of select="itu:docidentifier[@type = 'metanorma']"/>
9716
- <xsl:if test="not(itu:docidentifier[@type = 'metanorma'])">
9747
+ <xsl:value-of select="$docidentifier_metanorma"/>
9748
+ <xsl:if test="$docidentifier_metanorma = ''">
9717
9749
  <fo:inline padding-right="5mm">
9718
- <xsl:text>[</xsl:text>
9719
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9720
- <xsl:text>] </xsl:text>
9750
+ <xsl:variable name="docidentifier" select="normalize-space(itu:docidentifier[not(@type = 'metanorma-ordinal')])"/>
9751
+ <xsl:choose>
9752
+ <xsl:when test="$docidentifier != ''">
9753
+ <xsl:text>[</xsl:text>
9754
+ <xsl:value-of select="$docidentifier"/>
9755
+ <xsl:text>] </xsl:text>
9756
+ </xsl:when>
9757
+ <xsl:otherwise>
9758
+ <xsl:value-of select="$docidentifier_metanorma_ordinal"/>
9759
+ </xsl:otherwise>
9760
+ </xsl:choose>
9721
9761
  </fo:inline>
9722
9762
  </xsl:if>
9723
9763
  </xsl:variable>
9724
9764
 
9725
9765
  <xsl:variable name="bibitem_body">
9726
- <xsl:text> </xsl:text>
9727
- <xsl:choose>
9728
- <xsl:when test="itu:docidentifier[@type = 'metanorma']">
9729
- <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
9730
- </xsl:when>
9731
- <xsl:otherwise>
9732
- <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9733
- </xsl:otherwise>
9734
- </xsl:choose>
9735
- <xsl:if test="itu:formattedref and not(itu:docidentifier[@type = 'metanorma'])">, </xsl:if>
9766
+ <xsl:variable name="docidentifier">
9767
+ <xsl:text> </xsl:text>
9768
+ <xsl:choose>
9769
+ <xsl:when test="$docidentifier_metanorma != ''">
9770
+ <xsl:value-of select="itu:docidentifier[not(@type) or not(@type = 'metanorma' or @type = 'metanorma-ordinal')]"/>
9771
+ </xsl:when>
9772
+ <xsl:otherwise>
9773
+ <xsl:value-of select="itu:docidentifier[not(@type = 'metanorma-ordinal')]"/>
9774
+ </xsl:otherwise>
9775
+ </xsl:choose>
9776
+ </xsl:variable>
9777
+ <xsl:value-of select="$docidentifier"/>
9778
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
9736
9779
  <xsl:apply-templates select="itu:formattedref"/>
9737
9780
  </xsl:variable>
9738
9781
 
@@ -9749,9 +9792,27 @@
9749
9792
  </fo:table-body>
9750
9793
  </fo:table>
9751
9794
  </xsl:when> <!-- $doctype = 'implementers-guide' -->
9752
- <xsl:otherwise>
9795
+ <xsl:when test="$bibitem_label != $docidentifier_metanorma_ordinal">
9796
+ <xsl:attribute name="margin-left">14mm</xsl:attribute>
9797
+ <xsl:attribute name="text-indent">-14mm</xsl:attribute>
9753
9798
  <xsl:copy-of select="$bibitem_label"/>
9754
9799
  <xsl:copy-of select="$bibitem_body"/>
9800
+ </xsl:when>
9801
+ <xsl:otherwise>
9802
+ <fo:list-block provisional-distance-between-starts="14mm">
9803
+ <fo:list-item>
9804
+ <fo:list-item-label end-indent="label-end()">
9805
+ <fo:block>
9806
+ <xsl:copy-of select="$bibitem_label"/>
9807
+ </fo:block>
9808
+ </fo:list-item-label>
9809
+ <fo:list-item-body start-indent="body-start()">
9810
+ <fo:block>
9811
+ <xsl:copy-of select="$bibitem_body"/>
9812
+ </fo:block>
9813
+ </fo:list-item-body>
9814
+ </fo:list-item>
9815
+ </fo:list-block>
9755
9816
  </xsl:otherwise>
9756
9817
  </xsl:choose>
9757
9818
 
@@ -10339,7 +10400,7 @@
10339
10400
 
10340
10401
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
10341
10402
 
10342
- <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">
10403
+ <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">
10343
10404
 
10344
10405
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
10345
10406
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -11,8 +11,8 @@ module IsoDoc
11
11
  super
12
12
  end
13
13
 
14
- def prefix_container(container, linkend, _target)
15
- l10n("#{linkend} #{@i18n.get['in']} #{@xrefs.anchor(container, :xref)}")
14
+ def prefix_container(container, linkend, node, _target)
15
+ l10n("#{linkend} #{@i18n.get['in']} #{anchor_xref(node, container)}")
16
16
  end
17
17
 
18
18
  def eref(docxml)
@@ -16,12 +16,13 @@ module IsoDoc
16
16
  end
17
17
  end
18
18
 
19
- def annex_name_anchors(clause, num)
19
+ def annex_name_anchors(clause, num, level)
20
20
  lbl = annextype(clause)
21
- { label: annex_name_lbl(clause, num),
22
- elem: lbl,
23
- type: "clause", value: num.to_s, level: 1,
24
- xref: l10n("#{lbl} #{num}") }
21
+ @anchors[clause["id"]] =
22
+ { label: annex_name_lbl(clause, num),
23
+ elem: lbl,
24
+ type: "clause", value: num.to_s, level: level,
25
+ xref: l10n("#{lbl} #{num}") }
25
26
  end
26
27
 
27
28
  def annex_names1(clause, num, level)
@@ -38,7 +39,7 @@ module IsoDoc
38
39
  end
39
40
 
40
41
  def clause_names(docxml, sect_num)
41
- docxml.xpath(ns("//sections/clause[not(@unnumbered = 'true')]"\
42
+ docxml.xpath(ns("//sections/clause[not(@unnumbered = 'true')]" \
42
43
  "[not(@type = 'scope')][not(descendant::terms)]"))
43
44
  .each do |c|
44
45
  section_names(c, sect_num, 1)
@@ -65,10 +66,11 @@ module IsoDoc
65
66
  end
66
67
 
67
68
  def section_names1(clause, num, level)
69
+ x = @doctype == "resolution" ? num : l10n("#{@labels['clause']} #{num}")
68
70
  @anchors[clause["id"]] =
69
71
  { label: num, level: level,
70
72
  elem: @doctype == "resolution" ? "" : @labels["clause"],
71
- xref: @doctype == "resolution" ? num : l10n("#{@labels['clause']} #{num}") }
73
+ xref: x }
72
74
  i = Counter.new
73
75
  clause.xpath(ns(SUBCLAUSES)).each do |c|
74
76
  i.increment(c)