metanorma-gb 1.5.0 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe9a20b1e4d09c3ed8151c2021f51c1b8e412f823f0363db5bf0b9e4eb182908
4
- data.tar.gz: 6601454ed383cbb484434deebc8195d280a50f36282e0d84a096c1406751e322
3
+ metadata.gz: ab9365bdbf352b45cb58feccc8804e04c82bda509a54623a84c800af359c39f0
4
+ data.tar.gz: c338947fb0af4d92c264980787eef6330e53494b7df52e9aac7986161ac6d57b
5
5
  SHA512:
6
- metadata.gz: fd3154c799e5794a5b9a7a13b8cfe3eb2d70a0a1b1bb36ea6e1d85a9b14d8a5658726320734105f5abfcf1f0c8990ce2e9ce681cbc8d600d0702430f8416f048
7
- data.tar.gz: 8f90f5d26fe2601454ad8f6a27d6103d494443ce9948a25d2b2d697b9eb562018802cb08e529855916f2d8e7b4c0296e1e7001af8201374eda350ee4bf2fece0
6
+ metadata.gz: 9f78eb467c11c8da2b917bfd2aedbb90e408caabcff9c9438b930610d0a3601c2a7a5f8753cdbbae8f1f82a52b9dd335c8b29d725770e52238ae971aa269a19c
7
+ data.tar.gz: 728f36a37a994119a428d32f217a3407ecb6a68a437c51c248cdd2d6a245f74a3c11684d5a6eb53ecd19612dbc68c22267561dce2bbec8cf4ea98ea577012811
@@ -158,7 +158,17 @@
158
158
  <data type="ID"/>
159
159
  </attribute>
160
160
  <oneOrMore>
161
- <ref name="paragraph"/>
161
+ <choice>
162
+ <ref name="formula"/>
163
+ <ref name="ul"/>
164
+ <ref name="ol"/>
165
+ <ref name="dl"/>
166
+ <ref name="quote"/>
167
+ <ref name="sourcecode"/>
168
+ <ref name="paragraph"/>
169
+ <ref name="table"/>
170
+ <ref name="figure"/>
171
+ </choice>
162
172
  </oneOrMore>
163
173
  </element>
164
174
  </define>
@@ -402,6 +412,16 @@
402
412
  </choice>
403
413
  </attribute>
404
414
  </optional>
415
+ <optional>
416
+ <attribute name="valign">
417
+ <choice>
418
+ <value>top</value>
419
+ <value>middle</value>
420
+ <value>bottom</value>
421
+ <value>baseline</value>
422
+ </choice>
423
+ </attribute>
424
+ </optional>
405
425
  <choice>
406
426
  <zeroOrMore>
407
427
  <ref name="TextElement"/>
@@ -429,6 +449,16 @@
429
449
  </choice>
430
450
  </attribute>
431
451
  </optional>
452
+ <optional>
453
+ <attribute name="valign">
454
+ <choice>
455
+ <value>top</value>
456
+ <value>middle</value>
457
+ <value>bottom</value>
458
+ <value>baseline</value>
459
+ </choice>
460
+ </attribute>
461
+ </optional>
432
462
  <choice>
433
463
  <zeroOrMore>
434
464
  <ref name="TextElement"/>
@@ -45,7 +45,7 @@ module Asciidoctor
45
45
  if node.attr("docstage") && node.attr("docstage").to_i < 60
46
46
  abbr = IsoDoc::Gb::Metadata.new("en", "Latn", @i18n).
47
47
  status_abbrev(node.attr("docstage"), nil, node.attr("iteration"),
48
- node.attr("draft"), node.attr("doctype"))
48
+ node.attr("draft"), doctype(node))
49
49
  dn = "/#{abbr} #{dn}" # prefixes added in cleanup
50
50
  else
51
51
  dn += "-#{node.attr("copyright-year")}" if node.attr("copyright-year")
@@ -42,8 +42,11 @@
42
42
  </define>
43
43
  <define name="xref">
44
44
  <element name="xref">
45
+ <!-- attribute target { xsd:IDREF }, -->
45
46
  <attribute name="target">
46
- <data type="IDREF"/>
47
+ <data type="string">
48
+ <param name="pattern">\i\c*|\c+#\c+</param>
49
+ </data>
47
50
  </attribute>
48
51
  <optional>
49
52
  <attribute name="type">
@@ -578,6 +581,8 @@
578
581
  <ref name="ol"/>
579
582
  <ref name="dl"/>
580
583
  <ref name="formula"/>
584
+ <ref name="quote"/>
585
+ <ref name="sourcecode"/>
581
586
  </choice>
582
587
  </oneOrMore>
583
588
  </element>
@@ -661,6 +666,16 @@
661
666
  </choice>
662
667
  </attribute>
663
668
  </optional>
669
+ <optional>
670
+ <attribute name="valign">
671
+ <choice>
672
+ <value>top</value>
673
+ <value>middle</value>
674
+ <value>bottom</value>
675
+ <value>baseline</value>
676
+ </choice>
677
+ </attribute>
678
+ </optional>
664
679
  <choice>
665
680
  <zeroOrMore>
666
681
  <choice>
@@ -697,6 +712,16 @@
697
712
  </choice>
698
713
  </attribute>
699
714
  </optional>
715
+ <optional>
716
+ <attribute name="valign">
717
+ <choice>
718
+ <value>top</value>
719
+ <value>middle</value>
720
+ <value>bottom</value>
721
+ <value>baseline</value>
722
+ </choice>
723
+ </attribute>
724
+ </optional>
700
725
  <choice>
701
726
  <zeroOrMore>
702
727
  <choice>
@@ -1049,14 +1074,17 @@
1049
1074
  <ref name="section-title"/>
1050
1075
  </optional>
1051
1076
  <group>
1052
- <group>
1053
- <zeroOrMore>
1054
- <ref name="BasicBlock"/>
1055
- </zeroOrMore>
1056
- <zeroOrMore>
1057
- <ref name="note"/>
1058
- </zeroOrMore>
1059
- </group>
1077
+ <choice>
1078
+ <group>
1079
+ <zeroOrMore>
1080
+ <ref name="BasicBlock"/>
1081
+ </zeroOrMore>
1082
+ <zeroOrMore>
1083
+ <ref name="note"/>
1084
+ </zeroOrMore>
1085
+ </group>
1086
+ <ref name="amend"/>
1087
+ </choice>
1060
1088
  <zeroOrMore>
1061
1089
  <choice>
1062
1090
  <ref name="clause-subsection"/>
@@ -1507,4 +1535,79 @@
1507
1535
  <ref name="CitationType"/>
1508
1536
  </element>
1509
1537
  </define>
1538
+ <define name="amend">
1539
+ <element name="amend">
1540
+ <optional>
1541
+ <attribute name="id">
1542
+ <data type="ID"/>
1543
+ </attribute>
1544
+ </optional>
1545
+ <attribute name="change">
1546
+ <choice>
1547
+ <value>add</value>
1548
+ <value>modify</value>
1549
+ <value>delete</value>
1550
+ </choice>
1551
+ </attribute>
1552
+ <optional>
1553
+ <attribute name="path"/>
1554
+ </optional>
1555
+ <optional>
1556
+ <attribute name="path_end"/>
1557
+ </optional>
1558
+ <optional>
1559
+ <attribute name="title"/>
1560
+ </optional>
1561
+ <optional>
1562
+ <element name="location">
1563
+ <zeroOrMore>
1564
+ <ref name="locality"/>
1565
+ </zeroOrMore>
1566
+ </element>
1567
+ </optional>
1568
+ <zeroOrMore>
1569
+ <ref name="autonumber"/>
1570
+ </zeroOrMore>
1571
+ <optional>
1572
+ <element name="description">
1573
+ <zeroOrMore>
1574
+ <ref name="BasicBlock"/>
1575
+ </zeroOrMore>
1576
+ </element>
1577
+ </optional>
1578
+ <optional>
1579
+ <element name="newcontent">
1580
+ <zeroOrMore>
1581
+ <ref name="BasicBlock"/>
1582
+ </zeroOrMore>
1583
+ </element>
1584
+ </optional>
1585
+ <optional>
1586
+ <element name="description">
1587
+ <zeroOrMore>
1588
+ <ref name="BasicBlock"/>
1589
+ </zeroOrMore>
1590
+ </element>
1591
+ </optional>
1592
+ </element>
1593
+ </define>
1594
+ <define name="autonumber">
1595
+ <element name="autonumber">
1596
+ <attribute name="type">
1597
+ <choice>
1598
+ <value>requirement</value>
1599
+ <value>recommendation</value>
1600
+ <value>permission</value>
1601
+ <value>table</value>
1602
+ <value>figure</value>
1603
+ <value>admonition</value>
1604
+ <value>formula</value>
1605
+ <value>sourcecode</value>
1606
+ <value>example</value>
1607
+ <value>note</value>
1608
+ </choice>
1609
+ </attribute>
1610
+ <text/>
1611
+ </element>
1612
+ </define>
1510
1613
  </grammar>
@@ -37,23 +37,8 @@
37
37
  -->
38
38
  <xsl:variable name="contents">
39
39
  <contents>
40
- <xsl:apply-templates select="/gb:gb-standard/gb:preface/node()" mode="contents"/>
41
-
42
- <xsl:apply-templates select="/gb:gb-standard/gb:sections/gb:clause[1]" mode="contents"> <!-- [@id = '_scope'] -->
43
- <xsl:with-param name="sectionNum" select="'1'"/>
44
- </xsl:apply-templates>
45
- <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[1]" mode="contents"> <!-- [@id = '_normative_references'] -->
46
- <xsl:with-param name="sectionNum" select="'2'"/>
47
- </xsl:apply-templates>
48
- <xsl:apply-templates select="/gb:gb-standard/gb:sections/*[position() &gt; 1]" mode="contents"> <!-- @id != '_scope' -->
49
- <xsl:with-param name="sectionNumSkew" select="'1'"/>
50
- </xsl:apply-templates>
51
- <xsl:apply-templates select="/gb:gb-standard/gb:annex" mode="contents"/>
52
- <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[position() &gt; 1]" mode="contents"/> <!-- @id = '_bibliography' -->
53
-
54
- <xsl:apply-templates select="//gb:figure" mode="contents"/>
55
-
56
- <xsl:apply-templates select="//gb:table" mode="contents"/>
40
+ <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
41
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
57
42
  </contents>
58
43
  </xsl:variable>
59
44
 
@@ -62,7 +47,7 @@
62
47
  </xsl:variable>
63
48
 
64
49
  <xsl:template match="/">
65
- <xsl:message>INFO: Document namespace: '<xsl:value-of select="namespace-uri(/*)"/>'</xsl:message>
50
+ <xsl:call-template name="namespaceCheck"/>
66
51
  <fo:root font-family="SimSun" font-size="10.5pt" xml:lang="{$lang}"> <!-- -->
67
52
  <fo:layout-master-set>
68
53
 
@@ -344,32 +329,19 @@
344
329
 
345
330
  <fo:block line-height="220%">
346
331
  <xsl:variable name="margin-left">12</xsl:variable>
347
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true'][not(@level = 2 and starts-with(@section, '0'))]"><!-- skip clause from preface -->
332
+ <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [@display = 'true'][not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
348
333
  <fo:block text-align-last="justify">
349
334
  <xsl:if test="@level =2">
350
335
  <xsl:attribute name="margin-left">3.7mm</xsl:attribute>
351
336
  </xsl:if>
352
337
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
353
- <xsl:if test="normalize-space(@section) != '' and not(@display-section = 'false')">
354
- <fo:inline>
355
- <xsl:if test="@type = 'annex' and @level = 1">
356
- <xsl:attribute name="font-weight">bold</xsl:attribute>
357
- </xsl:if>
338
+ <xsl:if test="normalize-space(@section) != ''">
339
+ <fo:inline>
358
340
  <xsl:value-of select="@section"/>
359
341
  </fo:inline>
360
- <xsl:if test="not(@type = 'annex' and @level = 1)">
361
- <xsl:text>. </xsl:text>
362
- </xsl:if>
363
- <xsl:if test="@type = 'annex' and @level = 1">
364
- <xsl:text> </xsl:text>
365
- </xsl:if>
342
+ <xsl:value-of select="$tab_zh"/>
366
343
  </xsl:if>
367
- <xsl:if test="@addon != ''">
368
- <fo:inline font-weight="normal">(<xsl:value-of select="@addon"/>)</fo:inline>
369
- <xsl:text> </xsl:text>
370
- </xsl:if>
371
- <xsl:value-of select="text()"/>
372
- <xsl:text> </xsl:text>
344
+ <xsl:apply-templates/>
373
345
  <fo:inline keep-together.within-line="always">
374
346
  <fo:leader font-weight="normal" leader-pattern="dots"/>
375
347
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -383,8 +355,8 @@
383
355
  </fo:block-container>
384
356
 
385
357
  <!-- Foreword, Introduction -->
386
- <fo:block line-height="150%">
387
- <xsl:apply-templates select="/gb:gb-standard/gb:preface/node()"/>
358
+ <fo:block line-height="150%">
359
+ <xsl:call-template name="processPrefaceSectionsDefault"/>
388
360
  </fo:block>
389
361
 
390
362
  </fo:flow>
@@ -407,25 +379,7 @@
407
379
  </xsl:call-template>
408
380
  </fo:block>
409
381
 
410
- <xsl:apply-templates select="/gb:gb-standard/gb:sections/gb:clause[1]"> <!-- Scope -->
411
- <xsl:with-param name="sectionNum" select="'1'"/>
412
- </xsl:apply-templates>
413
-
414
- <!-- Normative references -->
415
- <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[1]">
416
- <xsl:with-param name="sectionNum" select="'2'"/>
417
- </xsl:apply-templates>
418
-
419
- <!-- Main sections -->
420
- <xsl:apply-templates select="/gb:gb-standard/gb:sections/*[position() &gt; 1]">
421
- <xsl:with-param name="sectionNumSkew" select="'1'"/>
422
- </xsl:apply-templates>
423
-
424
- <!-- Annex(s) -->
425
- <xsl:apply-templates select="/gb:gb-standard/gb:annex"/>
426
-
427
- <!-- Bibliography -->
428
- <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[position() &gt; 1]"/>
382
+ <xsl:call-template name="processMainSectionsDefault"/>
429
383
 
430
384
  </fo:block>
431
385
  </fo:flow>
@@ -482,185 +436,57 @@
482
436
  </xsl:if>
483
437
  </xsl:template>
484
438
 
485
- <!-- for pass the paremeter 'sectionNum' over templates, like 'tunnel' parameter in XSLT 2.0 -->
486
- <xsl:template match="node()">
487
- <xsl:param name="sectionNum"/>
488
- <xsl:param name="sectionNumSkew"/>
489
- <xsl:apply-templates>
490
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
491
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
492
- </xsl:apply-templates>
439
+ <xsl:template match="node()">
440
+ <xsl:apply-templates/>
493
441
  </xsl:template>
494
442
 
495
443
  <!-- ============================= -->
496
444
  <!-- CONTENTS -->
497
445
  <!-- ============================= -->
498
- <xsl:template match="node()" mode="contents">
499
- <xsl:param name="sectionNum"/>
500
- <xsl:param name="sectionNumSkew"/>
501
- <xsl:apply-templates mode="contents">
502
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
503
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
504
- </xsl:apply-templates>
446
+ <xsl:template match="node()" mode="contents">
447
+ <xsl:apply-templates mode="contents"/>
505
448
  </xsl:template>
506
449
 
507
-
508
- <!-- calculate main section number (1,2,3) and pass it deep into templates -->
509
- <!-- it's necessary, because there is itu:bibliography/itu:references from other section, but numbering should be sequental -->
510
- <xsl:template match="gb:gb-standard/gb:sections/*" mode="contents">
511
- <xsl:param name="sectionNum"/>
512
- <xsl:param name="sectionNumSkew" select="0"/>
513
- <xsl:variable name="sectionNum_">
514
- <xsl:choose>
515
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
516
- <xsl:when test="$sectionNumSkew != 0">
517
- <xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!-- gb:sections/gb:clause | gb:sections/gb:terms -->
518
- <xsl:value-of select="$number + $sectionNumSkew"/>
519
- </xsl:when>
520
- <xsl:otherwise>
521
- <xsl:number count="*"/>
522
- </xsl:otherwise>
523
- </xsl:choose>
524
- </xsl:variable>
525
- <xsl:apply-templates mode="contents">
526
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
527
- </xsl:apply-templates>
528
- </xsl:template>
529
-
530
- <!-- Any node with title element - clause, definition, annex,... -->
531
- <xsl:template match="gb:title | gb:preferred" mode="contents">
532
- <xsl:param name="sectionNum"/>
533
- <!-- sectionNum=<xsl:value-of select="$sectionNum"/> -->
534
- <xsl:variable name="id">
535
- <xsl:call-template name="getId"/>
536
- </xsl:variable>
537
-
450
+ <!-- element with title -->
451
+ <xsl:template match="*[gb:title]" mode="contents">
538
452
  <xsl:variable name="level">
539
- <xsl:call-template name="getLevel"/>
540
- </xsl:variable>
541
-
542
- <xsl:variable name="section">
543
- <xsl:call-template name="getSection">
544
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
453
+ <xsl:call-template name="getLevel">
454
+ <xsl:with-param name="depth" select="gb:title/@depth"/>
545
455
  </xsl:call-template>
546
456
  </xsl:variable>
547
457
 
548
458
  <xsl:variable name="display">
549
459
  <xsl:choose>
550
- <xsl:when test="ancestor::gb:bibitem">false</xsl:when>
551
- <xsl:when test="ancestor::gb:term">false</xsl:when>
552
- <xsl:when test="ancestor::gb:annex and $level &gt;= 3">false</xsl:when>
553
- <xsl:when test="$level &lt;= 3">true</xsl:when>
460
+ <xsl:when test="ancestor-or-self::gb:bibitem">false</xsl:when>
461
+ <xsl:when test="ancestor-or-self::gb:term">false</xsl:when>
462
+ <xsl:when test="$level &lt;= 2">true</xsl:when>
554
463
  <xsl:otherwise>false</xsl:otherwise>
555
464
  </xsl:choose>
556
465
  </xsl:variable>
557
466
 
558
- <xsl:variable name="display-section">true</xsl:variable>
559
-
560
- <xsl:variable name="type">
561
- <xsl:value-of select="local-name(..)"/>
562
- </xsl:variable>
563
-
564
- <xsl:variable name="root">
565
- <xsl:choose>
566
- <xsl:when test="ancestor::gb:annex">annex</xsl:when>
567
- </xsl:choose>
568
- </xsl:variable>
569
-
570
- <item id="{$id}" level="{$level}" section="{$section}" display-section="{$display-section}" display="{$display}" type="{$type}" root="{$root}">
571
- <xsl:attribute name="addon">
572
- <xsl:if test="local-name(..) = 'annex'">
573
- <xsl:variable name="obligation" select="../@obligation"/>
574
- <xsl:variable name="title-obligation-normative">
575
- <xsl:call-template name="getTitle">
576
- <xsl:with-param name="name" select="'title-obligation-normative'"/>
577
- </xsl:call-template>
578
- </xsl:variable>
579
- <xsl:choose>
580
- <xsl:when test="$obligation = 'normative'"><xsl:value-of select="$title-obligation-normative"/></xsl:when>
581
- <xsl:otherwise><xsl:value-of select="$obligation"/></xsl:otherwise>
582
- </xsl:choose>
583
- </xsl:if>
584
- </xsl:attribute>
585
- <xsl:value-of select="."/>
586
- </item>
467
+ <xsl:if test="$display = 'true'">
587
468
 
588
- <xsl:apply-templates mode="contents">
589
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
590
- </xsl:apply-templates>
469
+ <xsl:variable name="section">
470
+ <xsl:call-template name="getSection"/>
471
+ </xsl:variable>
472
+
473
+ <xsl:variable name="title">
474
+ <xsl:call-template name="getName"/>
475
+ </xsl:variable>
476
+
477
+ <xsl:variable name="type">
478
+ <xsl:value-of select="local-name()"/>
479
+ </xsl:variable>
480
+
481
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
482
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
483
+ </item>
484
+ <xsl:apply-templates mode="contents"/>
485
+ </xsl:if>
591
486
 
592
487
  </xsl:template>
593
488
 
594
489
 
595
- <xsl:template match="gb:figure" mode="contents">
596
- <item level="" id="{@id}" display="false">
597
- <xsl:attribute name="section">
598
- <xsl:call-template name="getFigureNumber"/>
599
- </xsl:attribute>
600
- </item>
601
- </xsl:template>
602
-
603
- <xsl:template match="gb:table" mode="contents">
604
- <xsl:param name="sectionNum"/>
605
- <xsl:variable name="annex-id" select="ancestor::gb:annex/@id"/>
606
- <item level="" id="{@id}" display="false" type="table">
607
- <xsl:attribute name="section">
608
- <xsl:variable name="title-table">
609
- <xsl:call-template name="getTitle">
610
- <xsl:with-param name="name" select="'title-table'"/>
611
- </xsl:call-template>
612
- </xsl:variable>
613
- <xsl:value-of select="$title-table"/>
614
- <xsl:choose>
615
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
616
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table']"/>
617
- </xsl:when>
618
- <xsl:when test="ancestor::*[local-name()='annex']">
619
- <xsl:number format="A-" count="gb:annex"/>
620
- <xsl:number format="1" level="any" count="gb:table[ancestor::gb:annex[@id = $annex-id]]"/>
621
- </xsl:when>
622
- <xsl:otherwise>
623
- <!-- <xsl:number format="1"/> -->
624
- <xsl:number format="1" level="any" count="*[local-name()='sections']//*[local-name()='table']"/>
625
- </xsl:otherwise>
626
- </xsl:choose>
627
- </xsl:attribute>
628
- <xsl:value-of select="gb:name/text()"/>
629
- </item>
630
- </xsl:template>
631
-
632
- <xsl:template match="gb:formula" mode="contents">
633
- <item level="" id="{@id}" display="false">
634
- <xsl:attribute name="section">
635
- <xsl:variable name="title-formula">
636
- <xsl:call-template name="getTitle">
637
- <xsl:with-param name="name" select="'title-formula'"/>
638
- </xsl:call-template>
639
- </xsl:variable>
640
- <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="gb:annex | gb:formula"/>
641
- </xsl:attribute>
642
- </item>
643
- </xsl:template>
644
-
645
- <xsl:template match="gb:li" mode="contents">
646
- <xsl:param name="sectionNum"/>
647
- <item level="" id="{@id}" display="false" type="li">
648
- <xsl:attribute name="section">
649
- <xsl:call-template name="getListItemFormat"/>
650
- </xsl:attribute>
651
- <xsl:attribute name="parent_section">
652
- <xsl:for-each select="ancestor::*[not(local-name() = 'p' or local-name() = 'ol')][1]">
653
- <xsl:call-template name="getSection">
654
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
655
- </xsl:call-template>
656
- </xsl:for-each>
657
- </xsl:attribute>
658
- </item>
659
- <xsl:apply-templates mode="contents">
660
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
661
- </xsl:apply-templates>
662
- </xsl:template>
663
-
664
490
  <xsl:template name="getListItemFormat">
665
491
  <xsl:choose>
666
492
  <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash -->
@@ -683,6 +509,9 @@
683
509
  <!-- ============================= -->
684
510
  <!-- ============================= -->
685
511
 
512
+ <xsl:template match="*[local-name() = 'tab']" priority="2">
513
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
514
+ </xsl:template>
686
515
 
687
516
  <xsl:template match="gb:license-statement//gb:title">
688
517
  <fo:block text-align="center" font-weight="bold">
@@ -729,87 +558,50 @@
729
558
  </fo:block>
730
559
  </xsl:template>
731
560
 
732
- <!-- Foreword, Introduction -->
733
- <xsl:template match="gb:gb-standard/gb:preface/*">
734
- <fo:block break-after="page"/>
735
- <xsl:apply-templates/>
736
- </xsl:template>
737
561
 
562
+ <!-- ====== -->
563
+ <!-- title -->
564
+ <!-- ====== -->
738
565
 
739
- <!-- clause, terms, clause, ...-->
740
- <xsl:template match="gb:gb-standard/gb:sections/*">
741
- <xsl:param name="sectionNum"/>
742
- <xsl:param name="sectionNumSkew" select="0"/>
743
- <fo:block>
744
- <xsl:variable name="pos"><xsl:number count="gb:sections/gb:clause | gb:sections/gb:terms"/></xsl:variable>
745
- <xsl:if test="$pos &gt;= 2">
746
- <xsl:attribute name="space-before">18pt</xsl:attribute>
747
- </xsl:if>
748
- <!-- pos=<xsl:value-of select="$pos" /> -->
749
- <xsl:variable name="sectionNum_">
750
- <xsl:choose>
751
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
752
- <xsl:when test="$sectionNumSkew != 0">
753
- <xsl:variable name="number"><xsl:number count="gb:sections/gb:clause | gb:sections/gb:terms"/></xsl:variable>
754
- <xsl:value-of select="$number + $sectionNumSkew"/>
755
- </xsl:when>
756
- </xsl:choose>
757
- </xsl:variable>
758
- <xsl:if test="not(gb:title)">
759
- <fo:block margin-top="3pt" margin-bottom="12pt">
760
- <xsl:value-of select="$sectionNum_"/><xsl:number format=".1 " level="multiple" count="gb:clause"/>
761
- </fo:block>
762
- </xsl:if>
763
- <xsl:apply-templates>
764
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
765
- </xsl:apply-templates>
566
+ <xsl:template match="gb:annex/gb:title">
567
+ <xsl:variable name="level">
568
+ <xsl:call-template name="getLevel"/>
569
+ </xsl:variable>
570
+ <xsl:variable name="font-family">
571
+ <xsl:choose>
572
+ <xsl:when test="$level &gt;= 3">SimSun</xsl:when>
573
+ <xsl:otherwise>SimHei</xsl:otherwise>
574
+ </xsl:choose>
575
+ </xsl:variable>
576
+ <fo:block font-family="{$font-family}" font-size="10.5pt" text-align="center" margin-bottom="24pt" keep-with-next="always">
577
+ <xsl:apply-templates/>
766
578
  </fo:block>
767
579
  </xsl:template>
768
580
 
769
-
770
- <xsl:template match="gb:clause//gb:clause[not(gb:title)]">
771
- <xsl:param name="sectionNum"/>
772
- <xsl:variable name="section">
773
- <xsl:call-template name="getSection">
774
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
775
- </xsl:call-template>
776
- </xsl:variable>
777
- <fo:block margin-top="6pt" margin-bottom="6pt" keep-with-next="always">
778
- <fo:inline font-family="SimHei">
779
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
780
- </fo:inline>
581
+ <!-- Bibliography -->
582
+ <xsl:template match="gb:references[not(@normative='true')]/gb:title">
583
+ <fo:block font-family="SimHei" text-align="center" margin-top="6pt" margin-bottom="16pt" keep-with-next="always">
584
+ <xsl:apply-templates/>
781
585
  </fo:block>
782
- <xsl:apply-templates>
783
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
784
- </xsl:apply-templates>
785
586
  </xsl:template>
786
587
 
787
-
788
588
  <xsl:template match="gb:title">
789
- <xsl:param name="sectionNum"/>
790
-
791
- <xsl:variable name="parent-name" select="local-name(..)"/>
792
- <xsl:variable name="references_num_current">
793
- <xsl:number level="any" count="gb:references"/>
794
- </xsl:variable>
795
-
796
- <xsl:variable name="id">
797
- <xsl:call-template name="getId"/>
798
- </xsl:variable>
799
589
 
800
590
  <xsl:variable name="level">
801
591
  <xsl:call-template name="getLevel"/>
802
592
  </xsl:variable>
803
593
 
804
- <xsl:variable name="section">
805
- <xsl:call-template name="getSection">
806
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
807
- </xsl:call-template>
594
+ <xsl:variable name="element-name">
595
+ <xsl:choose>
596
+ <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
597
+ <xsl:otherwise>fo:block</xsl:otherwise>
598
+ </xsl:choose>
808
599
  </xsl:variable>
809
600
 
810
601
  <xsl:variable name="font-family">
811
602
  <xsl:choose>
812
603
  <xsl:when test="ancestor::gb:annex and $level &gt;= 3">SimSun</xsl:when>
604
+ <xsl:when test="$element-name = 'fo:inline'">SimSun</xsl:when>
813
605
  <xsl:otherwise>SimHei</xsl:otherwise>
814
606
  </xsl:choose>
815
607
  </xsl:variable>
@@ -821,98 +613,65 @@
821
613
  </xsl:choose>
822
614
  </xsl:variable>
823
615
 
824
- <xsl:variable name="element-name">
825
- <xsl:choose>
826
- <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
827
- <xsl:otherwise>fo:block</xsl:otherwise>
828
- </xsl:choose>
829
- </xsl:variable>
830
616
 
831
- <xsl:choose>
832
- <xsl:when test="$parent-name = 'annex'">
833
- <fo:block id="{$id}" font-family="{$font-family}" font-size="{$font-size}" text-align="center" margin-bottom="12pt" keep-with-next="always">
834
- <xsl:value-of select="$section"/>
835
- <xsl:if test=" ../@obligation">
836
- <xsl:value-of select="$linebreak"/>
837
- <fo:inline font-weight="normal">
838
- <xsl:text>(</xsl:text>
839
- <xsl:variable name="obligation" select="../@obligation"/>
840
- <xsl:variable name="title-obligation-normative">
841
- <xsl:call-template name="getTitle">
842
- <xsl:with-param name="name" select="'title-obligation-normative'"/>
843
- </xsl:call-template>
844
- </xsl:variable>
845
- <xsl:choose>
846
- <xsl:when test="$obligation = 'normative'"><xsl:value-of select="$title-obligation-normative"/></xsl:when>
847
- <xsl:otherwise><xsl:value-of select="$obligation"/></xsl:otherwise>
848
- </xsl:choose>
849
- <xsl:text>)</xsl:text>
850
- </fo:inline>
851
- </xsl:if>
852
- <fo:block margin-top="14pt" margin-bottom="24pt"><xsl:apply-templates/></fo:block>
853
- </fo:block>
854
- </xsl:when>
855
- <xsl:when test="$parent-name = 'references' and $references_num_current != 1"> <!-- Bibliography -->
856
- <fo:block id="{$id}" font-family="{$font-family}" text-align="center" margin-top="6pt" margin-bottom="16pt" keep-with-next="always">
857
- <xsl:apply-templates/>
858
- </fo:block>
859
- </xsl:when>
617
+
618
+ <xsl:element name="{$element-name}">
619
+ <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
620
+ <xsl:attribute name="font-family"><xsl:value-of select="$font-family"/></xsl:attribute>
621
+ <xsl:attribute name="margin-top">
622
+ <xsl:choose>
623
+ <xsl:when test="ancestor::gb:preface">8pt</xsl:when>
624
+ <xsl:when test="$level = 2 and ancestor::gb:annex">10pt</xsl:when>
625
+ <xsl:when test="$level = 1">16pt</xsl:when>
626
+ <xsl:when test="$level = ''">6pt</xsl:when>
627
+ <xsl:when test="$level &gt;= 5">6pt</xsl:when>
628
+ <xsl:otherwise>12pt</xsl:otherwise>
629
+ </xsl:choose>
630
+ </xsl:attribute>
631
+ <xsl:attribute name="margin-bottom">
632
+ <xsl:choose>
633
+ <xsl:when test="ancestor::gb:preface">24pt</xsl:when>
634
+ <xsl:when test="$level = 1">16pt</xsl:when>
635
+ <xsl:when test="$level &gt;= 5">6pt</xsl:when>
636
+ <xsl:otherwise>8pt</xsl:otherwise>
637
+ </xsl:choose>
638
+ </xsl:attribute>
860
639
 
861
- <xsl:otherwise>
862
- <xsl:element name="{$element-name}">
863
- <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
864
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
865
- <xsl:attribute name="font-family"><xsl:value-of select="$font-family"/></xsl:attribute>
866
- <xsl:attribute name="margin-top">
867
- <xsl:choose>
868
- <xsl:when test="ancestor::gb:preface">8pt</xsl:when>
869
- <xsl:when test="$level = 2 and ancestor::gb:annex">10pt</xsl:when>
870
- <xsl:when test="$level = 1">16pt</xsl:when>
871
- <xsl:when test="$level = ''">6pt</xsl:when>
872
- <xsl:otherwise>12pt</xsl:otherwise>
873
- </xsl:choose>
874
- </xsl:attribute>
875
- <xsl:attribute name="margin-bottom">
876
- <xsl:choose>
877
- <xsl:when test="ancestor::gb:preface">24pt</xsl:when>
878
- <xsl:when test="$level = 1">16pt</xsl:when>
879
- <xsl:otherwise>8pt</xsl:otherwise>
880
- </xsl:choose>
881
- </xsl:attribute>
882
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
883
- <xsl:if test="ancestor::gb:preface">
884
- <xsl:attribute name="text-align">center</xsl:attribute>
885
- <xsl:attribute name="font-family">SimHei</xsl:attribute>
886
- </xsl:if>
887
- <xsl:if test="$element-name = 'fo:inline'">
888
- <xsl:attribute name="padding-left">7.4mm</xsl:attribute>
889
- </xsl:if>
890
-
891
- <xsl:value-of select="$section"/>
892
- <xsl:if test="$section != ''">. </xsl:if>
640
+
641
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
642
+ <xsl:if test="ancestor::gb:preface">
643
+ <xsl:attribute name="text-align">center</xsl:attribute>
644
+ <xsl:attribute name="font-family">SimHei</xsl:attribute>
645
+ </xsl:if>
646
+ <xsl:if test="$element-name = 'fo:inline'">
647
+ <xsl:attribute name="padding-left">7.4mm</xsl:attribute>
648
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
649
+ </xsl:if>
650
+
651
+ <xsl:apply-templates/>
652
+
653
+ <xsl:if test="$element-name = 'fo:inline'">
654
+ <xsl:value-of select="$tab_zh"/>
655
+ </xsl:if>
656
+
657
+ </xsl:element>
658
+
659
+ <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::gb:p)">
660
+ <!-- <fo:block> -->
661
+ <xsl:value-of select="$linebreak"/>
662
+ <!-- </fo:block> -->
663
+ </xsl:if>
893
664
 
894
- <xsl:apply-templates/>
895
- </xsl:element>
896
-
897
- <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::gb:p)">
898
- <!-- <fo:block> -->
899
- <xsl:value-of select="$linebreak"/>
900
- <!-- </fo:block> -->
901
- </xsl:if>
902
- </xsl:otherwise>
903
- </xsl:choose>
904
- </xsl:template>
665
+ </xsl:template>
666
+ <!-- ====== -->
667
+ <!-- ====== -->
905
668
 
906
-
907
669
 
908
- <xsl:template match="gb:p">
909
- <xsl:param name="inline" select="'false'"/>
670
+ <xsl:template match="gb:p">
910
671
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
911
672
  <xsl:variable name="element-name">
912
- <xsl:choose>
913
- <xsl:when test="$inline = 'true'">fo:inline</xsl:when>
914
- <xsl:when test="../@inline-header = 'true' and $previous-element = 'title'">fo:inline</xsl:when> <!-- first paragraph after inline title -->
915
- <!-- <xsl:when test="local-name(..) = 'admonition'">fo:inline</xsl:when> -->
673
+ <xsl:choose>
674
+ <xsl:when test="../@inline-header = 'true' and $previous-element = 'title'">fo:inline</xsl:when> <!-- first paragraph after inline title -->
916
675
  <xsl:otherwise>fo:block</xsl:otherwise>
917
676
  </xsl:choose>
918
677
  </xsl:variable>
@@ -922,7 +681,7 @@
922
681
  <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
923
682
  <xsl:when test="ancestor::gb:td/@align"><xsl:value-of select="ancestor::gb:td/@align"/></xsl:when>
924
683
  <xsl:when test="ancestor::gb:th/@align"><xsl:value-of select="ancestor::gb:th/@align"/></xsl:when>
925
- <xsl:otherwise>justify</xsl:otherwise><!-- left -->
684
+ <xsl:otherwise>justify</xsl:otherwise>
926
685
  </xsl:choose>
927
686
  </xsl:attribute>
928
687
  <xsl:attribute name="text-indent">
@@ -937,21 +696,9 @@
937
696
  </xsl:if>
938
697
  <xsl:apply-templates/>
939
698
  </xsl:element>
940
- <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
941
- <xsl:choose>
942
- <xsl:when test="ancestor::gb:annex">
943
- <xsl:value-of select="$linebreak"/>
944
- </xsl:when>
945
- <xsl:otherwise>
946
- <fo:block margin-bottom="12pt">
947
- <xsl:value-of select="$linebreak"/>
948
- </fo:block>
949
- </xsl:otherwise>
950
- </xsl:choose>
951
- </xsl:if>
952
- <xsl:if test="$inline = 'true'">
953
- <fo:block> </fo:block>
954
- </xsl:if>
699
+ <xsl:if test="$element-name = 'fo:inline' and not(local-name(..) = 'admonition')">
700
+ <xsl:value-of select="$linebreak"/>
701
+ </xsl:if>
955
702
  </xsl:template>
956
703
 
957
704
  <xsl:template match="gb:li//gb:p//text()">
@@ -994,13 +741,13 @@
994
741
  <fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
995
742
  <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
996
743
  <!-- <xsl:value-of select="@reference"/> -->
997
- <xsl:value-of select="$number + count(//gb:bibitem[ancestor::gb:references[@id='_normative_references' or not(preceding-sibling::gb:references)]]/gb:note)"/>
744
+ <xsl:value-of select="$number + count(//gb:bibitem[ancestor::gb:references[@normative='true' or not(preceding-sibling::gb:references)]]/gb:note)"/>
998
745
  </fo:basic-link>
999
746
  </fo:inline>
1000
747
  <fo:footnote-body>
1001
748
  <fo:block font-size="9pt" margin-bottom="12pt">
1002
749
  <fo:inline font-size="50%" id="footnote_{@reference}_{$number}" keep-with-next.within-line="always" vertical-align="super">
1003
- <xsl:value-of select="$number + count(//gb:bibitem[ancestor::gb:references[@id='_normative_references' or not(preceding-sibling::gb:references)]]/gb:note)"/>
750
+ <xsl:value-of select="$number + count(//gb:bibitem[ancestor::gb:references[@normative='true' or not(preceding-sibling::gb:references)]]/gb:note)"/>
1004
751
  </fo:inline>
1005
752
  <xsl:for-each select="gb:p">
1006
753
  <xsl:apply-templates/>
@@ -1023,90 +770,6 @@
1023
770
  <xsl:apply-templates/>
1024
771
  </xsl:template>
1025
772
 
1026
- <xsl:template match="gb:review">
1027
- <!-- comment 2019-11-29 -->
1028
- <!-- <fo:block font-weight="bold">Review:</fo:block>
1029
- <xsl:apply-templates /> -->
1030
- </xsl:template>
1031
-
1032
- <xsl:template match="text()">
1033
- <xsl:value-of select="."/>
1034
- </xsl:template>
1035
-
1036
- <xsl:template match="gb:image">
1037
- <fo:block-container text-align="center">
1038
- <fo:block>
1039
- <fo:external-graphic src="{@src}" fox:alt-text="Image {@alt}"/>
1040
- </fo:block>
1041
- <fo:block font-family="SimHei" margin-top="12pt" margin-bottom="12pt">
1042
- <xsl:variable name="title-figure">
1043
- <xsl:call-template name="getTitle">
1044
- <xsl:with-param name="name" select="'title-figure'"/>
1045
- </xsl:call-template>
1046
- </xsl:variable>
1047
- <xsl:value-of select="$title-figure"/>
1048
- <xsl:call-template name="getFigureNumber"/>
1049
- </fo:block>
1050
- </fo:block-container>
1051
- </xsl:template>
1052
-
1053
- <xsl:template match="gb:figure">
1054
- <fo:block-container id="{@id}">
1055
- <fo:block>
1056
- <xsl:apply-templates/>
1057
- </fo:block>
1058
- <xsl:call-template name="fn_display_figure"/>
1059
- <xsl:for-each select="gb:note//gb:p">
1060
- <xsl:call-template name="note"/>
1061
- </xsl:for-each>
1062
- <fo:block font-family="SimHei" text-align="center" margin-top="12pt" margin-bottom="12pt" keep-with-previous="always">
1063
- <xsl:call-template name="getFigureNumber"/>
1064
- <xsl:if test="gb:name">
1065
- <!-- <xsl:if test="not(local-name(..) = 'figure')"> -->
1066
- <xsl:text> — </xsl:text>
1067
- <!-- </xsl:if> -->
1068
- <xsl:value-of select="gb:name"/>
1069
- </xsl:if>
1070
- </fo:block>
1071
- </fo:block-container>
1072
- </xsl:template>
1073
-
1074
- <xsl:template name="getFigureNumber">
1075
- <xsl:variable name="title-figure">
1076
- <xsl:call-template name="getTitle">
1077
- <xsl:with-param name="name" select="'title-figure'"/>
1078
- </xsl:call-template>
1079
- </xsl:variable>
1080
- <xsl:choose>
1081
- <xsl:when test="ancestor::gb:annex">
1082
- <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="gb:annex | gb:figure"/>
1083
- </xsl:when>
1084
- <xsl:otherwise>
1085
- <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any"/>
1086
- </xsl:otherwise>
1087
- </xsl:choose>
1088
- </xsl:template>
1089
-
1090
- <xsl:template match="gb:figure/gb:name"/>
1091
- <xsl:template match="gb:figure/gb:fn" priority="2"/>
1092
- <xsl:template match="gb:figure/gb:note"/>
1093
-
1094
-
1095
- <xsl:template match="gb:figure/gb:image">
1096
- <fo:block text-align="center">
1097
- <xsl:variable name="src">
1098
- <xsl:choose>
1099
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
1100
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
1101
- </xsl:when>
1102
- <xsl:otherwise>
1103
- <xsl:value-of select="@src"/>
1104
- </xsl:otherwise>
1105
- </xsl:choose>
1106
- </xsl:variable>
1107
- <fo:external-graphic src="{$src}" width="100%" content-height="100%" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- src="{@src}" -->
1108
- </fo:block>
1109
- </xsl:template>
1110
773
 
1111
774
 
1112
775
  <xsl:template match="gb:bibitem">
@@ -1134,7 +797,7 @@
1134
797
  </xsl:template>
1135
798
 
1136
799
 
1137
- <xsl:template match="gb:bibitem/gb:note">
800
+ <xsl:template match="gb:bibitem/gb:note" priority="2">
1138
801
  <fo:footnote>
1139
802
  <xsl:variable name="number">
1140
803
  <xsl:number level="any" count="gb:bibitem/gb:note"/>
@@ -1157,19 +820,19 @@
1157
820
 
1158
821
 
1159
822
 
1160
- <xsl:template match="gb:ul | gb:ol">
823
+ <xsl:template match="gb:ul | gb:ol" mode="ul_ol">
1161
824
  <fo:list-block margin-bottom="12pt" margin-left="7.4mm" provisional-distance-between-starts="4mm"> <!-- margin-bottom="8pt" -->
1162
825
  <xsl:if test="local-name() = 'ol'">
1163
826
  <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute>
1164
827
  </xsl:if>
1165
828
  <xsl:apply-templates/>
1166
829
  </fo:list-block>
1167
- <xsl:for-each select="./gb:note//gb:p">
830
+ <xsl:for-each select="./gb:note">
1168
831
  <xsl:call-template name="note"/>
1169
832
  </xsl:for-each>
1170
833
  </xsl:template>
1171
834
 
1172
- <xsl:template match="gb:ul//gb:note | gb:ol//gb:note"/>
835
+ <xsl:template match="gb:ul//gb:note | gb:ol//gb:note" priority="2"/>
1173
836
 
1174
837
  <xsl:template match="gb:li">
1175
838
  <fo:list-item id="{@id}">
@@ -1179,42 +842,26 @@
1179
842
  </fo:block>
1180
843
  </fo:list-item-label>
1181
844
  <fo:list-item-body start-indent="body-start()">
1182
- <xsl:apply-templates/>
1183
- <xsl:apply-templates select=".//gb:note" mode="process"/>
845
+ <fo:block>
846
+ <xsl:apply-templates/>
847
+ <xsl:apply-templates select=".//gb:note" mode="process"/>
848
+ </fo:block>
1184
849
  </fo:list-item-body>
1185
850
  </fo:list-item>
1186
851
  </xsl:template>
1187
852
 
1188
-
1189
- <xsl:template match="gb:term">
1190
- <xsl:param name="sectionNum"/>
1191
- <fo:block id="{@id}" font-family="SimHei" font-size="11pt" keep-with-next="always" margin-top="10pt" margin-bottom="8pt" line-height="1.1">
1192
- <fo:inline>
1193
- <xsl:variable name="section">
1194
- <xsl:for-each select="*[1]">
1195
- <xsl:call-template name="getSection">
1196
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1197
- </xsl:call-template>
1198
- </xsl:for-each>
1199
- </xsl:variable>
1200
- <xsl:value-of select="$section"/><xsl:text>.</xsl:text>
1201
- </fo:inline>
1202
- </fo:block>
1203
- <fo:block>
1204
- <xsl:apply-templates>
1205
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1206
- </xsl:apply-templates>
1207
- </fo:block>
853
+ <xsl:template match="gb:note" mode="process">
854
+ <xsl:call-template name="note"/>
1208
855
  </xsl:template>
1209
856
 
1210
- <xsl:template match="gb:preferred">
1211
- <xsl:param name="sectionNum"/>
1212
-
857
+
858
+ <xsl:template match="gb:preferred" priority="2">
859
+
1213
860
  <fo:inline font-family="SimHei" font-size="11pt">
1214
861
  <xsl:if test="not(preceding-sibling::*[1][local-name() = 'preferred'])">
1215
862
  <xsl:attribute name="padding-left">7.4mm</xsl:attribute>
1216
863
  </xsl:if>
1217
- <xsl:apply-templates/><xsl:text> </xsl:text>
864
+ <xsl:apply-templates/><xsl:value-of select="$tab_zh"/>
1218
865
  </fo:inline>
1219
866
 
1220
867
  <xsl:if test="not(following-sibling::*[1][local-name() = 'preferred'])">
@@ -1223,14 +870,13 @@
1223
870
 
1224
871
  </xsl:template>
1225
872
 
1226
- <xsl:template match="gb:admitted">
1227
- <xsl:param name="sectionNum"/>
873
+ <xsl:template match="gb:admitted" priority="2">
1228
874
 
1229
875
  <fo:inline font-size="11pt">
1230
876
  <xsl:if test="not(preceding-sibling::*[1][local-name() = 'admitted'])">
1231
877
  <xsl:attribute name="padding-left">7.4mm</xsl:attribute>
1232
878
  </xsl:if>
1233
- <xsl:apply-templates/><xsl:text> </xsl:text>
879
+ <xsl:apply-templates/><xsl:value-of select="$tab_zh"/>
1234
880
  </fo:inline>
1235
881
 
1236
882
  <xsl:if test="not(following-sibling::*[1][local-name() = 'admitted'])">
@@ -1239,8 +885,8 @@
1239
885
 
1240
886
  </xsl:template>
1241
887
 
1242
- <xsl:template match="gb:deprecates">
1243
- <xsl:param name="sectionNum"/>
888
+
889
+ <xsl:template match="gb:deprecates" priority="2">
1244
890
  <fo:inline font-size="11pt">
1245
891
  <xsl:if test="not(preceding-sibling::*[1][local-name() = 'deprecates'])">
1246
892
  <xsl:attribute name="padding-left">7.4mm</xsl:attribute>
@@ -1255,48 +901,12 @@
1255
901
  </fo:inline>
1256
902
  <xsl:if test="not(following-sibling::*[1][local-name() = 'deprecates'])">
1257
903
  <xsl:value-of select="$linebreak"/>
1258
- </xsl:if>
1259
-
1260
- </xsl:template>
1261
-
1262
- <xsl:template match="gb:definition[preceding-sibling::gb:domain]">
1263
- <xsl:apply-templates/>
1264
- </xsl:template>
1265
- <xsl:template match="gb:definition[preceding-sibling::gb:domain]/gb:p">
1266
- <fo:inline> <xsl:apply-templates/></fo:inline>
1267
- <fo:block> </fo:block>
1268
- </xsl:template>
1269
-
1270
- <xsl:template match="gb:definition">
1271
- <fo:block>
1272
- <xsl:apply-templates/>
1273
- </fo:block>
1274
- </xsl:template>
1275
-
1276
- <xsl:template match="gb:termsource">
1277
- <fo:block text-indent="7.4mm">
1278
- <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
1279
- <fo:basic-link internal-destination="{gb:origin/@bibitemid}" fox:alt-text="{gb:origin/@citeas}">
1280
- <xsl:text>[</xsl:text> <!-- SOURCE: -->
1281
- <xsl:value-of select="gb:origin/@citeas"/>
1282
-
1283
- <xsl:apply-templates select="gb:origin/gb:localityStack"/>
1284
-
1285
- </fo:basic-link>
1286
- <xsl:apply-templates select="gb:modification"/>
1287
- <xsl:text>]</xsl:text>
1288
- </fo:block>
904
+ </xsl:if>
1289
905
  </xsl:template>
1290
906
 
1291
907
 
1292
- <xsl:template match="gb:modification/gb:p">
1293
- <xsl:apply-templates/>
1294
- </xsl:template>
1295
- <xsl:template match="gb:modification/text()">
1296
- <xsl:apply-templates/>
1297
- </xsl:template>
1298
908
 
1299
- <xsl:template match="gb:termnote">
909
+ <xsl:template match="gb:termnote" priority="2">
1300
910
  <fo:block-container font-size="9pt" margin-left="7.4mm" margin-top="4pt" line-height="125%">
1301
911
  <fo:block-container margin-left="0mm">
1302
912
  <fo:table table-layout="fixed" width="100%">
@@ -1306,13 +916,7 @@
1306
916
  <fo:table-row>
1307
917
  <fo:table-cell>
1308
918
  <fo:block font-family="SimHei">
1309
- <xsl:variable name="num"><xsl:number/></xsl:variable>
1310
- <xsl:variable name="title-note-to-entry">
1311
- <xsl:call-template name="getTitle">
1312
- <xsl:with-param name="name" select="'title-note-to-entry'"/>
1313
- </xsl:call-template>
1314
- </xsl:variable>
1315
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
919
+ <xsl:apply-templates select="gb:name" mode="presentation"/>
1316
920
  </fo:block>
1317
921
  </fo:table-cell>
1318
922
  <fo:table-cell>
@@ -1327,48 +931,14 @@
1327
931
  </fo:block-container>
1328
932
  </xsl:template>
1329
933
 
1330
- <xsl:template match="gb:termnote/gb:p">
1331
- <fo:inline><xsl:apply-templates/></fo:inline>
1332
- </xsl:template>
1333
-
1334
- <xsl:template match="gb:domain">
1335
- <fo:inline padding-left="7.4mm">&lt;<xsl:apply-templates/>&gt; </fo:inline>
1336
- </xsl:template>
1337
-
1338
-
1339
- <xsl:template match="gb:termexample">
1340
- <fo:block font-size="9pt" margin-top="14pt" margin-bottom="14pt" text-align="justify">
1341
- <fo:inline padding-right="1mm" font-family="SimHei">
1342
- <xsl:variable name="title-example">
1343
- <xsl:call-template name="getTitle">
1344
- <xsl:with-param name="name" select="'title-example'"/>
1345
- </xsl:call-template>
1346
- </xsl:variable>
1347
- <xsl:value-of select="$title-example"/>
1348
- <xsl:if test="count(ancestor::gb:term[1]//gb:termexample) &gt; 1">
1349
- <xsl:number/>
1350
- </xsl:if>
1351
- <xsl:text>:</xsl:text>
1352
- </fo:inline>
1353
- <xsl:apply-templates/>
1354
- </fo:block>
1355
- </xsl:template>
1356
-
1357
- <xsl:template match="gb:termexample/gb:p">
1358
- <fo:inline><xsl:apply-templates/></fo:inline>
1359
- </xsl:template>
1360
934
 
1361
-
1362
- <xsl:template match="gb:annex">
1363
- <fo:block break-after="page"/>
1364
- <xsl:apply-templates/>
1365
- </xsl:template>
1366
935
 
1367
-
1368
936
  <!-- <xsl:template match="gb:references[@id = '_bibliography']"> -->
1369
- <xsl:template match="gb:references[position() &gt; 1]">
937
+ <xsl:template match="gb:references[not(@normative='true')]">
1370
938
  <fo:block break-after="page"/>
1371
- <xsl:apply-templates/>
939
+ <fo:block id="{@id}">
940
+ <xsl:apply-templates/>
941
+ </fo:block>
1372
942
  <fo:block-container text-align="center">
1373
943
  <fo:block-container margin-left="63mm" width="42mm" border-bottom="2pt solid black">
1374
944
  <fo:block> </fo:block>
@@ -1379,7 +949,7 @@
1379
949
 
1380
950
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1381
951
  <!-- <xsl:template match="gb:references[@id = '_bibliography']/gb:bibitem"> -->
1382
- <xsl:template match="gb:references[position() &gt; 1]/gb:bibitem">
952
+ <xsl:template match="gb:references[not(@normative='true')]/gb:bibitem">
1383
953
  <fo:list-block font-size="11pt" margin-bottom="12pt" provisional-distance-between-starts="12mm">
1384
954
  <fo:list-item>
1385
955
  <fo:list-item-label end-indent="label-end()">
@@ -1418,208 +988,30 @@
1418
988
  </xsl:template>
1419
989
 
1420
990
  <!-- <xsl:template match="gb:references[@id = '_bibliography']/gb:bibitem" mode="contents"/> -->
1421
- <xsl:template match="gb:references[position() &gt; 1]/gb:bibitem" mode="contents"/>
991
+ <xsl:template match="gb:references[not(@normative='true')]/gb:bibitem" mode="contents"/>
1422
992
 
1423
993
  <!-- <xsl:template match="gb:references[@id = '_bibliography']/gb:bibitem/gb:title"> -->
1424
- <xsl:template match="gb:references[position() &gt; 1]/gb:bibitem/gb:title">
994
+ <xsl:template match="gb:references[not(@normative='true')]/gb:bibitem/gb:title">
1425
995
  <fo:inline font-style="italic">
1426
996
  <xsl:apply-templates/>
1427
997
  </fo:inline>
1428
998
  </xsl:template>
1429
999
 
1430
- <xsl:template match="gb:quote">
1431
- <fo:block margin-top="12pt" margin-left="12mm" margin-right="12mm">
1432
- <xsl:apply-templates select=".//gb:p"/>
1433
- </fo:block>
1434
- <fo:block text-align="right">
1435
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
1436
- <xsl:text>— </xsl:text><xsl:value-of select="gb:author"/>
1437
- <xsl:if test="gb:source">
1438
- <xsl:text>, </xsl:text>
1439
- <xsl:apply-templates select="gb:source"/>
1440
- </xsl:if>
1441
- </fo:block>
1442
- </xsl:template>
1443
-
1444
- <xsl:template match="gb:source">
1445
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1446
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1447
- <xsl:apply-templates select="gb:localityStack"/>
1448
- </fo:basic-link>
1449
- </xsl:template>
1450
-
1451
1000
 
1452
1001
  <xsl:template match="mathml:math" priority="2">
1453
1002
  <fo:inline font-family="Cambria Math">
1003
+ <xsl:variable name="mathml">
1004
+ <xsl:apply-templates select="." mode="mathml"/>
1005
+ </xsl:variable>
1454
1006
  <fo:instream-foreign-object fox:alt-text="Math">
1455
- <xsl:copy-of select="."/>
1007
+ <!-- <xsl:copy-of select="."/> -->
1008
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
1456
1009
  </fo:instream-foreign-object>
1457
1010
  </fo:inline>
1458
1011
  </xsl:template>
1459
1012
 
1460
- <xsl:template match="gb:xref">
1461
- <xsl:param name="sectionNum"/>
1462
-
1463
- <xsl:variable name="target" select="normalize-space(@target)"/>
1464
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{$target}">
1465
- <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = $target]/@section"/>
1466
- <!-- <xsl:if test="not(starts-with($section, 'Figure') or starts-with($section, 'Table'))"> -->
1467
- <!-- <xsl:attribute name="color">blue</xsl:attribute>
1468
- <xsl:attribute name="text-decoration">underline</xsl:attribute> -->
1469
- <!-- </xsl:if> -->
1470
- <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = $target]/@type"/>
1471
- <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id =$target]/@root"/>
1472
- <xsl:variable name="level" select="xalan:nodeset($contents)//item[@id =$target]/@level"/>
1473
-
1474
- <xsl:variable name="title-clause">
1475
- <xsl:call-template name="getTitle">
1476
- <xsl:with-param name="name" select="'title-clause'"/>
1477
- </xsl:call-template>
1478
- </xsl:variable>
1479
- <xsl:variable name="title-annex">
1480
- <xsl:call-template name="getTitle">
1481
- <xsl:with-param name="name" select="'title-annex'"/>
1482
- </xsl:call-template>
1483
- </xsl:variable>
1484
-
1485
- <xsl:choose>
1486
- <xsl:when test="$type = 'clause' and $root != 'annex' and $level = 1"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) -->
1487
- <xsl:when test="$type = 'clause' and $root = 'annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1488
- <xsl:when test="$type = 'li'">
1489
- <xsl:attribute name="color">black</xsl:attribute>
1490
- <xsl:attribute name="text-decoration">none</xsl:attribute>
1491
- <xsl:variable name="parent_section" select="xalan:nodeset($contents)//item[@id =$target]/@parent_section"/>
1492
- <xsl:variable name="currentSection">
1493
- <xsl:call-template name="getSection"/>
1494
- </xsl:variable>
1495
- <xsl:if test="not(contains($parent_section, $currentSection))">
1496
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{$target}">
1497
- <xsl:attribute name="color">blue</xsl:attribute>
1498
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1499
- <xsl:value-of select="$parent_section"/><xsl:text> </xsl:text>
1500
- </fo:basic-link>
1501
- </xsl:if>
1502
- </xsl:when>
1503
- <xsl:when test="normalize-space($section) = ''">
1504
- <xsl:text>[</xsl:text><xsl:value-of select="$target"/><xsl:text>]</xsl:text>
1505
- </xsl:when>
1506
- <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1507
- </xsl:choose>
1508
- <xsl:value-of select="$section"/>
1509
- </fo:basic-link>
1510
- </xsl:template>
1511
-
1512
- <xsl:template match="gb:example/gb:p">
1513
- <fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt">
1514
- <!-- <xsl:if test="ancestor::gb:li">
1515
- <xsl:attribute name="font-size">11pt</xsl:attribute>
1516
- </xsl:if> -->
1517
- <xsl:variable name="claims_id" select="ancestor::gb:clause[1]/@id"/>
1518
- <fo:inline padding-right="5mm">
1519
- <xsl:variable name="title-example">
1520
- <xsl:call-template name="getTitle">
1521
- <xsl:with-param name="name" select="'title-example'"/>
1522
- </xsl:call-template>
1523
- </xsl:variable>
1524
- <xsl:value-of select="$title-example"/>
1525
- <xsl:if test="count(ancestor::gb:clause[1]//gb:example) &gt; 1">
1526
- <xsl:number count="gb:example[ancestor::gb:clause[@id = $claims_id]]" level="any"/>
1527
- </xsl:if>
1528
- </fo:inline>
1529
- <xsl:apply-templates/>
1530
- </fo:block>
1531
- </xsl:template>
1532
-
1533
- <xsl:template match="gb:note/gb:p" name="note">
1534
- <xsl:variable name="claims_id" select="ancestor::gb:clause[1]/@id"/>
1535
- <fo:block-container font-size="9pt" margin-left="7.4mm" margin-top="4pt" line-height="125%">
1536
- <fo:block-container margin-left="0mm">
1537
- <fo:table table-layout="fixed" width="100%">
1538
- <fo:table-column column-width="10mm"/>
1539
- <fo:table-column column-width="155mm"/>
1540
- <fo:table-body>
1541
- <fo:table-row>
1542
- <fo:table-cell>
1543
- <fo:block font-family="SimHei">
1544
- <xsl:variable name="title-note">
1545
- <xsl:call-template name="getTitle">
1546
- <xsl:with-param name="name" select="'title-note'"/>
1547
- </xsl:call-template>
1548
- </xsl:variable>
1549
- <xsl:value-of select="normalize-space($title-note)"/>
1550
- <xsl:if test="count(ancestor::gb:clause[1]//gb:note) &gt; 1">
1551
- <xsl:text> </xsl:text><xsl:number count="gb:note[ancestor::gb:clause[@id = $claims_id]]" level="any"/>
1552
- </xsl:if>
1553
- <xsl:text>:</xsl:text>
1554
- </fo:block>
1555
- </fo:table-cell>
1556
- <fo:table-cell>
1557
- <fo:block text-align="justify">
1558
- <xsl:apply-templates/>
1559
- </fo:block>
1560
- </fo:table-cell>
1561
- </fo:table-row>
1562
- </fo:table-body>
1563
- </fo:table>
1564
- </fo:block-container>
1565
- </fo:block-container>
1566
- </xsl:template>
1567
1013
 
1568
- <!-- <eref type="inline" bibitemid="IEC60050-113" citeas="IEC 60050-113:2011"><localityStack><locality type="clause"><referenceFrom>113-01-12</referenceFrom></locality></localityStack></eref> -->
1569
- <xsl:template match="gb:eref">
1570
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> <!-- font-size="9pt" color="blue" vertical-align="super" -->
1571
- <xsl:if test="@type = 'footnote'">
1572
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1573
- <xsl:attribute name="font-size">50%</xsl:attribute>
1574
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1575
- <xsl:attribute name="vertical-align">super</xsl:attribute>
1576
- </xsl:if>
1577
- <!-- <xsl:if test="@type = 'inline'">
1578
- <xsl:attribute name="color">blue</xsl:attribute>
1579
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1580
- </xsl:if> -->
1581
-
1582
- <xsl:choose>
1583
- <xsl:when test="@citeas and normalize-space(text()) = ''">
1584
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1585
- </xsl:when>
1586
- <xsl:when test="@bibitemid and normalize-space(text()) = ''">
1587
- <xsl:value-of select="//gb:bibitem[@id = current()/@bibitemid]/gb:docidentifier"/>
1588
- </xsl:when>
1589
- <xsl:otherwise/>
1590
- </xsl:choose>
1591
- <xsl:apply-templates select="gb:localityStack"/>
1592
- <xsl:apply-templates select="text()"/>
1593
- </fo:basic-link>
1594
- </xsl:template>
1595
-
1596
- <xsl:template match="gb:locality">
1597
- <xsl:variable name="title-clause">
1598
- <xsl:call-template name="getTitle">
1599
- <xsl:with-param name="name" select="'title-clause'"/>
1600
- </xsl:call-template>
1601
- </xsl:variable>
1602
- <xsl:variable name="title-annex">
1603
- <xsl:call-template name="getTitle">
1604
- <xsl:with-param name="name" select="'title-annex'"/>
1605
- </xsl:call-template>
1606
- </xsl:variable>
1607
- <xsl:variable name="title-table">
1608
- <xsl:call-template name="getTitle">
1609
- <xsl:with-param name="name" select="'title-table'"/>
1610
- </xsl:call-template>
1611
- </xsl:variable>
1612
- <xsl:choose>
1613
- <xsl:when test="@type ='section' and ancestor::gb:termsource">SOURCE Section </xsl:when>
1614
- <xsl:when test="ancestor::gb:termsource"/>
1615
- <xsl:when test="@type ='clause' and ancestor::gb:eref"/>
1616
- <xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1617
- <xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1618
- <xsl:when test="@type ='table'"><xsl:value-of select="$title-table"/></xsl:when>
1619
- <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1620
- </xsl:choose>
1621
- <xsl:text> </xsl:text><xsl:value-of select="gb:referenceFrom"/>
1622
- </xsl:template>
1014
+
1623
1015
 
1624
1016
  <xsl:template match="gb:admonition">
1625
1017
  <xsl:variable name="title-caution">
@@ -1644,23 +1036,15 @@
1644
1036
  </fo:block>
1645
1037
  </xsl:template>
1646
1038
 
1647
- <xsl:template match="gb:formula">
1648
- <fo:block id="{@id}">
1649
- <xsl:apply-templates/>
1650
- </fo:block>
1651
- </xsl:template>
1652
-
1653
- <xsl:template match="gb:formula/gb:dt/gb:stem">
1654
- <fo:inline>
1655
- <xsl:apply-templates/>
1656
- </fo:inline>
1657
- </xsl:template>
1658
-
1039
+
1659
1040
  <xsl:template match="gb:formula/gb:stem">
1660
- <fo:block font-size="11pt" margin-top="14pt" margin-bottom="14pt">
1661
- <fo:table table-layout="fixed" width="170mm">
1662
- <fo:table-column column-width="165mm"/>
1663
- <fo:table-column column-width="5mm"/>
1041
+ <fo:block margin-top="14pt" margin-bottom="14pt">
1042
+ <xsl:if test="not(ancestor::*[local-name()='note'])">
1043
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1044
+ </xsl:if>
1045
+ <fo:table table-layout="fixed" width="100%"> <!-- width="170mm" -->
1046
+ <fo:table-column column-width="95%"/><!-- 165mm -->
1047
+ <fo:table-column column-width="5%"/> <!-- 5mm -->
1664
1048
  <fo:table-body>
1665
1049
  <fo:table-row>
1666
1050
  <fo:table-cell display-align="center">
@@ -1670,28 +1054,16 @@
1670
1054
  </fo:table-cell>
1671
1055
  <fo:table-cell display-align="center">
1672
1056
  <fo:block text-align="left">
1673
- <xsl:choose>
1674
- <xsl:when test="ancestor::gb:annex">
1675
- <xsl:number format="(A.1)" level="multiple" count="gb:annex | gb:formula"/>
1676
- </xsl:when>
1677
- <xsl:otherwise> <!-- not(ancestor::gb:annex) -->
1678
- <xsl:number format="(1)" level="any" count="gb:formula"/>
1679
- </xsl:otherwise>
1680
- </xsl:choose>
1057
+ <xsl:apply-templates select="../gb:name" mode="presentation"/>
1681
1058
  </fo:block>
1682
1059
  </fo:table-cell>
1683
1060
  </fo:table-row>
1684
1061
  </fo:table-body>
1685
- </fo:table>
1686
- <fo:inline keep-together.within-line="always">
1687
- </fo:inline>
1062
+ </fo:table>
1688
1063
  </fo:block>
1689
1064
  </xsl:template>
1690
1065
 
1691
- <xsl:template match="gb:br" priority="2">
1692
- <!-- <fo:block>&#xA0;</fo:block> -->
1693
- <xsl:value-of select="$linebreak"/>
1694
- </xsl:template>
1066
+
1695
1067
 
1696
1068
  <xsl:template name="insertHeaderFooter">
1697
1069
  <fo:static-content flow-name="header">
@@ -1724,88 +1096,6 @@
1724
1096
  </xsl:template>
1725
1097
 
1726
1098
 
1727
- <xsl:template name="getSection">
1728
- <xsl:param name="sectionNum"/>
1729
- <xsl:variable name="level">
1730
- <xsl:call-template name="getLevel"/>
1731
- </xsl:variable>
1732
- <xsl:variable name="section">
1733
- <xsl:choose>
1734
- <xsl:when test="ancestor::gb:bibliography">
1735
- <xsl:value-of select="$sectionNum"/>
1736
- </xsl:when>
1737
- <xsl:when test="ancestor::gb:sections">
1738
- <!-- 1, 2, 3, 4, ... from main section (not annex, bibliography, ...) -->
1739
- <xsl:choose>
1740
- <xsl:when test="$level = 1">
1741
- <xsl:value-of select="$sectionNum"/>
1742
- </xsl:when>
1743
- <xsl:when test="$level &gt;= 2">
1744
- <xsl:variable name="num">
1745
- <xsl:call-template name="getSubSection"/>
1746
- </xsl:variable>
1747
- <xsl:value-of select="concat($sectionNum, $num)"/>
1748
- </xsl:when>
1749
- <xsl:otherwise>
1750
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1751
- </xsl:otherwise>
1752
- </xsl:choose>
1753
- </xsl:when>
1754
- <xsl:when test="ancestor::gb:annex">
1755
- <xsl:variable name="annexid" select="normalize-space(/gb:gb-standard/gb:bibdata/gb:ext/gb:structuredidentifier/gb:annexid)"/>
1756
- <xsl:choose>
1757
- <xsl:when test="$level = 1">
1758
- <xsl:variable name="title-annex">
1759
- <xsl:call-template name="getTitle">
1760
- <xsl:with-param name="name" select="'title-annex'"/>
1761
- </xsl:call-template>
1762
- </xsl:variable>
1763
- <xsl:value-of select="$title-annex"/>
1764
- <xsl:choose>
1765
- <xsl:when test="count(//gb:annex) = 1 and $annexid != ''">
1766
- <xsl:value-of select="$annexid"/>
1767
- </xsl:when>
1768
- <xsl:otherwise>
1769
- <xsl:number format="A" level="any" count="gb:annex"/>
1770
- </xsl:otherwise>
1771
- </xsl:choose>
1772
- </xsl:when>
1773
- <xsl:otherwise>
1774
- <xsl:choose>
1775
- <xsl:when test="count(//gb:annex) = 1 and $annexid != ''">
1776
- <xsl:value-of select="$annexid"/><xsl:number format=".1" level="multiple" count="gb:clause"/>
1777
- </xsl:when>
1778
- <xsl:otherwise>
1779
- <xsl:number format="A.1" level="multiple" count="gb:annex | gb:clause"/>
1780
- </xsl:otherwise>
1781
- </xsl:choose>
1782
- </xsl:otherwise>
1783
- </xsl:choose>
1784
- </xsl:when>
1785
- <xsl:when test="ancestor::gb:preface"> <!-- if preface and there is clause(s) -->
1786
- <xsl:choose>
1787
- <xsl:when test="$level = 1 and ..//gb:clause">0</xsl:when>
1788
- <xsl:when test="$level &gt;= 2">
1789
- <xsl:variable name="num">
1790
- <xsl:number format=".1" level="multiple" count="gb:clause"/>
1791
- </xsl:variable>
1792
- <xsl:value-of select="concat('0', $num)"/>
1793
- </xsl:when>
1794
- <xsl:otherwise>
1795
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1796
- </xsl:otherwise>
1797
- </xsl:choose>
1798
- </xsl:when>
1799
- <xsl:otherwise>
1800
- </xsl:otherwise>
1801
- </xsl:choose>
1802
- </xsl:variable>
1803
- <xsl:value-of select="$section"/>
1804
- </xsl:template>
1805
-
1806
- <!-- <xsl:variable name="Image-GB-Logo">
1807
- <xsl:text>R0lGODlhWAIvAcQSAEBAQL+/v39/f4CAgO/v7xAQEDAwMJ+fn8/Pz2BgYCAgIN/f31BQUK+vr4+Pj3BwcP///wAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAABYAi8BAAX/oCSOZGmeaKqubOu+MBIcgpAAOBDtfO//wKBwSCwaj8gkEUBwIRTKqHRKrVqvWF4hh6sJGgEEbEwum8/otHqdWgRsgEJ2Tq/bpQcX487v+/+APlsMXwFsh4iJiouLCAcPOoGSk5REAi6RlZqbnJUGCQ6GjKOkpaZnBA0CmUhbOQ8DsbKztLW2t7i5uru8vb6/tAY+ly2sEQzAycrLzM3Oz843OcJRAA8NTafa29yJDQ/URQDIBwEBEOjp6uvs7e7v8PHy8/T19vIHP8QsxgUI9wADChxIsKDBg+sImHMwgEEcIwAciOlGsaJFEwgcGAPyKRQBhCBDihxJrwGQfSs2//ojybKly5cwFTqARETBg4kXc+pcFOABFCEKQJ2DSbSoUXcI5OzYswOlikgGwq08SrWqVaOOEvwEYnPBzq9gyTRIoJTrtQVX06oFmZSHAQI8nKaIxETqv7V48+qlt+AA2SAA8oQdTHgEgg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YUG+UVI6KlUDMuA91R478pgLFFI18IgA7KojVe4xwZwORs42egUAIw4yqCYzjakAE8ABaVo3qYUTdyIjKuIzuyYuwMXTyGiM8JQBrhYx7GAC/i4zrUjwDkET/+DNQ5QP6k0QWlowICgCu6AO4VpDDUzwXpTwAEAEVaSAgAADs=</xsl:text>
1808
- </xsl:variable> -->
1809
1099
 
1810
1100
  <xsl:template name="addLetterSpacing">
1811
1101
  <xsl:param name="text"/>
@@ -1821,46 +1111,6 @@
1821
1111
  </xsl:template>
1822
1112
 
1823
1113
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
1824
-
1825
- <title-table lang="en">Table </title-table>
1826
- <title-table lang="fr">Tableau </title-table>
1827
-
1828
-
1829
- <title-table lang="zh">表 </title-table>
1830
-
1831
-
1832
- <title-note lang="en">NOTE </title-note>
1833
- <title-note lang="fr">NOTE </title-note>
1834
-
1835
-
1836
- <title-note lang="zh">注 </title-note>
1837
-
1838
-
1839
- <title-figure lang="en">Figure </title-figure>
1840
- <title-figure lang="fr">Figure </title-figure>
1841
-
1842
-
1843
- <title-figure lang="zh">图 </title-figure>
1844
-
1845
-
1846
- <title-example lang="en">EXAMPLE </title-example>
1847
- <title-example lang="fr">EXEMPLE </title-example>
1848
-
1849
-
1850
- <title-example lang="zh">示例 </title-example>
1851
-
1852
-
1853
- <title-example-xref lang="en">Example </title-example-xref>
1854
- <title-example-xref lang="fr">Exemple </title-example-xref>
1855
-
1856
- <title-section lang="en">Section </title-section>
1857
- <title-section lang="fr">Section </title-section>
1858
-
1859
- <title-inequality lang="en">Inequality </title-inequality>
1860
- <title-inequality lang="fr">Inequality </title-inequality>
1861
-
1862
- <title-equation lang="en">Equation </title-equation>
1863
- <title-equation lang="fr">Equation </title-equation>
1864
1114
 
1865
1115
  <title-annex lang="en">Annex </title-annex>
1866
1116
  <title-annex lang="fr">Annexe </title-annex>
@@ -1868,25 +1118,13 @@
1868
1118
 
1869
1119
  <title-annex lang="zh">附件 </title-annex>
1870
1120
 
1871
-
1872
- <title-appendix lang="en">Appendix </title-appendix>
1873
- <title-appendix lang="fr">Appendix </title-appendix>
1874
-
1875
- <title-clause lang="en">Clause </title-clause>
1876
- <title-clause lang="fr">Article </title-clause>
1877
-
1878
-
1879
- <title-clause lang="zh">条 </title-clause>
1880
-
1881
-
1121
+
1882
1122
  <title-edition lang="en">
1883
1123
 
1884
1124
 
1885
1125
  </title-edition>
1886
1126
 
1887
- <title-formula lang="en">Formula </title-formula>
1888
- <title-formula lang="fr">Formula </title-formula>
1889
-
1127
+
1890
1128
  <title-toc lang="en">
1891
1129
 
1892
1130
 
@@ -1925,13 +1163,6 @@
1925
1163
  </title-part>
1926
1164
  <title-part lang="zh">第 # 部分:</title-part>
1927
1165
 
1928
- <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
1929
- <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
1930
-
1931
-
1932
- <title-note-to-entry lang="zh">注#: </title-note-to-entry>
1933
-
1934
-
1935
1166
  <title-modified lang="en">modified</title-modified>
1936
1167
  <title-modified lang="fr">modifiée</title-modified>
1937
1168
 
@@ -1939,20 +1170,23 @@
1939
1170
  <title-modified lang="zh">改写</title-modified>
1940
1171
 
1941
1172
 
1942
- <title-source lang="en">SOURCE</title-source>
1173
+ <title-source lang="en">
1174
+
1175
+ <xsl:text>SOURCE</xsl:text>
1176
+
1177
+
1178
+ </title-source>
1943
1179
 
1944
1180
  <title-keywords lang="en">Keywords</title-keywords>
1945
1181
 
1946
1182
  <title-deprecated lang="en">DEPRECATED</title-deprecated>
1947
1183
  <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1948
-
1949
- <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
1950
-
1184
+
1951
1185
  <title-list-tables lang="en">List of Tables</title-list-tables>
1952
1186
 
1953
1187
  <title-list-figures lang="en">List of Figures</title-list-figures>
1954
1188
 
1955
- <title-recommendation lang="en">Recommendation </title-recommendation>
1189
+ <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1956
1190
 
1957
1191
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1958
1192
 
@@ -1962,8 +1196,6 @@
1962
1196
 
1963
1197
  <title-in lang="en">in </title-in>
1964
1198
 
1965
- <title-box lang="en">Box </title-box>
1966
-
1967
1199
  <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1968
1200
  <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1969
1201
 
@@ -1986,7 +1218,11 @@
1986
1218
  <title-warning lang="zh">警告</title-warning>
1987
1219
 
1988
1220
  <title-amendment lang="en">AMENDMENT</title-amendment>
1989
- </xsl:variable><xsl:template name="getTitle">
1221
+
1222
+ <title-continued lang="en">(continued)</title-continued>
1223
+ <title-continued lang="fr">(continué)</title-continued>
1224
+
1225
+ </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1990
1226
  <xsl:param name="name"/>
1991
1227
  <xsl:variable name="lang">
1992
1228
  <xsl:call-template name="getLang"/>
@@ -2003,10 +1239,12 @@
2003
1239
  </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
2004
1240
 
2005
1241
 
1242
+
2006
1243
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1244
+ <xsl:attribute name="white-space">pre</xsl:attribute>
1245
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2007
1246
 
2008
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2009
- <xsl:attribute name="font-size">9pt</xsl:attribute>
1247
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
2010
1248
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2011
1249
 
2012
1250
 
@@ -2016,198 +1254,437 @@
2016
1254
 
2017
1255
 
2018
1256
 
2019
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2020
-
2021
- <xsl:attribute name="font-size">12pt</xsl:attribute>
2022
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2023
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
2024
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2025
1257
 
1258
+ </xsl:attribute-set><xsl:attribute-set name="permission-style">
2026
1259
 
1260
+ </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
2027
1261
 
2028
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1262
+ </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
2029
1263
 
2030
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2031
- <xsl:attribute name="margin-top">8pt</xsl:attribute>
2032
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1264
+ </xsl:attribute-set><xsl:attribute-set name="requirement-style">
2033
1265
 
1266
+ </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
2034
1267
 
1268
+ </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1269
+
1270
+ </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1271
+ </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1272
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1273
+
1274
+
1275
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
1276
+
1277
+
1278
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
1279
+
1280
+ </xsl:attribute-set><xsl:attribute-set name="termexample-style">
1281
+
1282
+
1283
+
1284
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
1285
+ <xsl:attribute name="margin-top">14pt</xsl:attribute>
1286
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
1287
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1288
+
1289
+
1290
+
1291
+
1292
+
1293
+ </xsl:attribute-set><xsl:attribute-set name="example-style">
1294
+
1295
+
1296
+
1297
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1298
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1299
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+ </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1310
+
1311
+
1312
+
1313
+ </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1314
+
1315
+
1316
+
1317
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
2035
1318
 
2036
- </xsl:attribute-set><xsl:template match="text()">
2037
- <xsl:value-of select="."/>
2038
- </xsl:template><xsl:template match="*[local-name()='br']">
2039
- <xsl:value-of select="$linebreak"/>
2040
- </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2041
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
2042
- <xsl:call-template name="add-zero-spaces-java"/>
2043
- </xsl:template><xsl:template match="*[local-name()='table']">
2044
-
2045
- <xsl:variable name="simple-table">
2046
- <!-- <xsl:copy> -->
2047
- <xsl:call-template name="getSimpleTable"/>
2048
- <!-- </xsl:copy> -->
2049
- </xsl:variable>
2050
-
2051
- <!-- DEBUG -->
2052
- <!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable -->
2053
- <!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable -->
2054
-
2055
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2056
1319
 
2057
- <!-- <xsl:if test="$namespace = 'iso'">
2058
- <fo:block space-before="6pt">&#xA0;</fo:block>
2059
- </xsl:if> -->
2060
1320
 
2061
- <xsl:choose>
2062
- <xsl:when test="@unnumbered = 'true'"/>
2063
- <xsl:otherwise>
2064
-
2065
-
2066
-
2067
- <fo:block font-weight="bold" text-align="center" margin-bottom="6pt" keep-with-next="always">
2068
-
2069
-
2070
-
2071
-
2072
-
2073
-
2074
-
2075
- <xsl:attribute name="font-family">SimHei</xsl:attribute>
2076
- <xsl:attribute name="font-weight">normal</xsl:attribute>
2077
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2078
-
2079
-
2080
- <xsl:variable name="title-table">
2081
- <xsl:call-template name="getTitle">
2082
- <xsl:with-param name="name" select="'title-table'"/>
2083
- </xsl:call-template>
2084
- </xsl:variable>
2085
- <xsl:value-of select="$title-table"/>
2086
-
2087
- <xsl:call-template name="getTableNumber"/>
2088
-
2089
-
2090
- <xsl:if test="*[local-name()='name']">
2091
-
2092
-
2093
-
2094
- <xsl:text> — </xsl:text>
2095
-
2096
- <xsl:apply-templates select="*[local-name()='name']" mode="process"/>
2097
- </xsl:if>
2098
- </fo:block>
2099
-
2100
-
2101
- <xsl:call-template name="fn_name_display"/>
2102
-
2103
- </xsl:otherwise>
2104
- </xsl:choose>
2105
1321
 
2106
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2107
1322
 
2108
- <!-- <xsl:variable name="cols-count">
2109
- <xsl:choose>
2110
- <xsl:when test="*[local-name()='thead']">
2111
- <xsl:call-template name="calculate-columns-numbers">
2112
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2113
- </xsl:call-template>
2114
- </xsl:when>
2115
- <xsl:otherwise>
2116
- <xsl:call-template name="calculate-columns-numbers">
2117
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2118
- </xsl:call-template>
2119
- </xsl:otherwise>
2120
- </xsl:choose>
2121
- </xsl:variable> -->
2122
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2123
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2124
1323
 
2125
1324
 
2126
1325
 
2127
- <xsl:variable name="colwidths">
2128
- <xsl:call-template name="calculate-column-widths">
2129
- <xsl:with-param name="cols-count" select="$cols-count"/>
2130
- <xsl:with-param name="table" select="$simple-table"/>
2131
- </xsl:call-template>
2132
- </xsl:variable>
2133
1326
 
2134
- <!-- <xsl:variable name="colwidths2">
2135
- <xsl:call-template name="calculate-column-widths">
2136
- <xsl:with-param name="cols-count" select="$cols-count"/>
2137
- </xsl:call-template>
2138
- </xsl:variable> -->
2139
1327
 
2140
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2141
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2142
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2143
1328
 
2144
- <xsl:variable name="margin-left">
2145
- <xsl:choose>
2146
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2147
- <xsl:otherwise>0</xsl:otherwise>
2148
- </xsl:choose>
2149
- </xsl:variable>
2150
1329
 
2151
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2152
-
2153
-
2154
-
2155
-
2156
-
2157
-
2158
-
2159
-
2160
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
2161
-
2162
-
2163
1330
 
1331
+
1332
+
1333
+
1334
+ </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1335
+
1336
+
1337
+
1338
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1339
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1340
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1341
+
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1353
+
1354
+
1355
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1356
+ <xsl:attribute name="font-family">SimHei</xsl:attribute>
1357
+
1358
+
2164
1359
 
1360
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1361
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1362
+
1363
+
1364
+ <xsl:attribute name="text-align">center</xsl:attribute>
1365
+ <xsl:attribute name="font-family">SimHei</xsl:attribute>
1366
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1367
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1368
+
1369
+
1370
+
2165
1371
 
1372
+
1373
+
1374
+
2166
1375
 
1376
+
1377
+
1378
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2167
1379
 
1380
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1381
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1382
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1383
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1384
+
1385
+
1386
+
1387
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1388
+
1389
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1390
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1391
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1392
+
1393
+
1394
+
1395
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
1396
+
1397
+
1398
+
1399
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1400
+
1401
+
1402
+
1403
+
1404
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1405
+
1406
+
1407
+
1408
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
1409
+ <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
1410
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
1411
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
1412
+ <xsl:attribute name="line-height">125%</xsl:attribute>
1413
+
2168
1414
 
1415
+
1416
+
1417
+
1418
+
1419
+
1420
+
1421
+
1422
+
1423
+
1424
+ </xsl:attribute-set><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">
1425
+
1426
+
1427
+
1428
+ <xsl:attribute name="font-family">SimHei</xsl:attribute>
1429
+
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1440
+
1441
+
1442
+
1443
+ <xsl:attribute name="margin-top">4pt</xsl:attribute>
1444
+ <xsl:attribute name="line-height">125%</xsl:attribute>
1445
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1446
+
2169
1447
 
2170
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1448
+
1449
+
1450
+
1451
+
1452
+
1453
+
1454
+
1455
+
1456
+
1457
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2171
1464
 
1465
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1466
+
1467
+
1468
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1469
+ <xsl:attribute name="margin-left">12mm</xsl:attribute>
1470
+ <xsl:attribute name="margin-right">12mm</xsl:attribute>
1471
+
1472
+
1473
+
1474
+
1475
+
1476
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1477
+
1478
+
1479
+ <xsl:attribute name="text-align">right</xsl:attribute>
2172
1480
 
2173
1481
 
2174
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2175
- <xsl:choose>
2176
- <xsl:when test=". = 1 or . = 0">
2177
- <fo:table-column column-width="proportional-column-width(2)"/>
2178
- </xsl:when>
2179
- <xsl:otherwise>
2180
- <fo:table-column column-width="proportional-column-width({.})"/>
2181
- </xsl:otherwise>
2182
- </xsl:choose>
2183
- </xsl:for-each>
1482
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1483
+
1484
+
1485
+
1486
+ <xsl:attribute name="text-indent">7.4mm</xsl:attribute>
1487
+
1488
+
1489
+
1490
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1491
+
1492
+
1493
+
1494
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1495
+
1496
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2184
1497
 
2185
- <xsl:choose>
2186
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2187
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2188
- </xsl:when>
2189
- <xsl:otherwise>
2190
- <xsl:apply-templates/>
2191
- </xsl:otherwise>
2192
- </xsl:choose>
1498
+
1499
+
1500
+
1501
+
1502
+
1503
+ <xsl:attribute name="font-family">SimHei</xsl:attribute>
1504
+ <xsl:attribute name="text-align">center</xsl:attribute>
1505
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
1506
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1507
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+
1518
+
1519
+
1520
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1521
+
1522
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1523
+ <xsl:attribute name="text-align">center</xsl:attribute>
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1530
+
1531
+ </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1532
+
1533
+
1534
+ <xsl:attribute name="width">100%</xsl:attribute>
1535
+ <xsl:attribute name="content-height">100%</xsl:attribute>
1536
+ <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
1537
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1538
+
1539
+
2193
1540
 
2194
- </fo:table>
1541
+
1542
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1543
+
1544
+
1545
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1546
+
1547
+
1548
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1549
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1550
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1551
+ <xsl:attribute name="text-align">center</xsl:attribute>
1552
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1553
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1554
+
1555
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1556
+
1557
+ <xsl:attribute name="padding-left">7.4mm</xsl:attribute>
1558
+
1559
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1560
+
1561
+
1562
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1563
+
1564
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1565
+
1566
+
1567
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1568
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1569
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1570
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1571
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1572
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1573
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1574
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1575
+
1576
+ <!-- Normative references -->
1577
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1578
+ <!-- Terms and definitions -->
1579
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
1580
+ <!-- Another main sections -->
1581
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
1582
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1583
+ <!-- Bibliography -->
1584
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1585
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1586
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1587
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1588
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1589
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1590
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1591
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1592
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1593
+
1594
+ <!-- Normative references -->
1595
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1596
+ <!-- Terms and definitions -->
1597
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
1598
+ <!-- Another main sections -->
1599
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
1600
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1601
+ <!-- Bibliography -->
1602
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1603
+ </xsl:template><xsl:template match="text()">
1604
+ <xsl:value-of select="."/>
1605
+ </xsl:template><xsl:template match="*[local-name()='br']">
1606
+ <xsl:value-of select="$linebreak"/>
1607
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1608
+ <!-- <xsl:call-template name="add-zero-spaces"/> -->
1609
+ <xsl:call-template name="add-zero-spaces-java"/>
1610
+ </xsl:template><xsl:template match="*[local-name()='table']">
1611
+
1612
+ <xsl:variable name="simple-table">
1613
+ <xsl:call-template name="getSimpleTable"/>
1614
+ </xsl:variable>
1615
+
1616
+
1617
+
1618
+
1619
+
1620
+ <!-- $namespace = 'iso' or -->
1621
+
1622
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1623
+
1624
+
1625
+
1626
+ <xsl:call-template name="fn_name_display"/>
1627
+
1628
+
1629
+
1630
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1631
+
1632
+ <!-- <xsl:variable name="cols-count">
1633
+ <xsl:choose>
1634
+ <xsl:when test="*[local-name()='thead']">
1635
+ <xsl:call-template name="calculate-columns-numbers">
1636
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1637
+ </xsl:call-template>
1638
+ </xsl:when>
1639
+ <xsl:otherwise>
1640
+ <xsl:call-template name="calculate-columns-numbers">
1641
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1642
+ </xsl:call-template>
1643
+ </xsl:otherwise>
1644
+ </xsl:choose>
1645
+ </xsl:variable> -->
1646
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1647
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1648
+
1649
+
1650
+
1651
+ <xsl:variable name="colwidths">
1652
+ <xsl:call-template name="calculate-column-widths">
1653
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1654
+ <xsl:with-param name="table" select="$simple-table"/>
1655
+ </xsl:call-template>
1656
+ </xsl:variable>
1657
+
1658
+ <!-- <xsl:variable name="colwidths2">
1659
+ <xsl:call-template name="calculate-column-widths">
1660
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1661
+ </xsl:call-template>
1662
+ </xsl:variable> -->
1663
+
1664
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1665
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1666
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1667
+
1668
+ <xsl:variable name="margin-left">
1669
+ <xsl:choose>
1670
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1671
+ <xsl:otherwise>0</xsl:otherwise>
1672
+ </xsl:choose>
1673
+ </xsl:variable>
1674
+
1675
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2195
1676
 
2196
1677
 
2197
- <xsl:apply-templates select="*[local-name()='note']" mode="process"/>
2198
1678
 
2199
1679
 
2200
- </fo:block-container>
2201
- </xsl:template><xsl:template name="getTableNumber">
2202
- <xsl:choose>
2203
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
2204
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
2205
- </xsl:when>
2206
- <xsl:when test="ancestor::*[local-name()='annex']">
1680
+
1681
+
1682
+
1683
+
1684
+
1685
+ <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
2207
1686
 
2208
1687
 
2209
- <xsl:variable name="annex-id" select="ancestor::gb:annex/@id"/>
2210
- <xsl:number format="A." count="*[local-name()='annex']"/><xsl:number format="1" level="any" count="*[local-name()='table'][(not(@unnumbered) or @unnumbered != 'true') and ancestor::gb:annex[@id = $annex-id]]"/>
2211
1688
 
2212
1689
 
2213
1690
 
@@ -2215,17 +1692,49 @@
2215
1692
 
2216
1693
 
2217
1694
 
2218
- </xsl:when>
2219
- <xsl:otherwise>
1695
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2220
1696
 
2221
1697
 
2222
- <xsl:number format="A." count="*[local-name()='annex']"/>
2223
- <xsl:number format="1" level="any" count="//*[local-name()='table'] [not(ancestor::*[local-name()='annex']) and not(ancestor::*[local-name()='executivesummary']) and not(ancestor::*[local-name()='bibdata'])] [not(@unnumbered) or @unnumbered != 'true']"/>
2224
-
2225
- </xsl:otherwise>
2226
- </xsl:choose>
2227
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
2228
- <xsl:apply-templates/>
1698
+
1699
+
1700
+
1701
+
1702
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1703
+ <xsl:choose>
1704
+ <xsl:when test=". = 1 or . = 0">
1705
+ <fo:table-column column-width="proportional-column-width(2)"/>
1706
+ </xsl:when>
1707
+ <xsl:otherwise>
1708
+ <fo:table-column column-width="proportional-column-width({.})"/>
1709
+ </xsl:otherwise>
1710
+ </xsl:choose>
1711
+ </xsl:for-each>
1712
+
1713
+ <xsl:choose>
1714
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
1715
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1716
+ </xsl:when>
1717
+ <xsl:otherwise>
1718
+ <xsl:apply-templates/>
1719
+ </xsl:otherwise>
1720
+ </xsl:choose>
1721
+
1722
+ </fo:table>
1723
+
1724
+
1725
+ <xsl:apply-templates select="*[local-name()='note']" mode="process"/>
1726
+
1727
+
1728
+
1729
+
1730
+ </fo:block-container>
1731
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1732
+ <xsl:if test="normalize-space() != ''">
1733
+ <fo:block xsl:use-attribute-sets="table-name-style">
1734
+
1735
+ <xsl:apply-templates/>
1736
+ </fo:block>
1737
+ </xsl:if>
2229
1738
  </xsl:template><xsl:template name="calculate-columns-numbers">
2230
1739
  <xsl:param name="table-row"/>
2231
1740
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2340,10 +1849,25 @@
2340
1849
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2341
1850
  <xsl:param name="cols-count"/>
2342
1851
  <!-- font-weight="bold" -->
2343
- <fo:table-header>
2344
-
1852
+ <fo:table-header>
1853
+
2345
1854
  <xsl:apply-templates/>
2346
1855
  </fo:table-header>
1856
+ </xsl:template><xsl:template name="table-header-title">
1857
+ <xsl:param name="cols-count"/>
1858
+ <!-- row for title -->
1859
+ <fo:table-row>
1860
+ <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">
1861
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1862
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1863
+ <xsl:call-template name="fn_name_display"/>
1864
+ </xsl:for-each>
1865
+ <fo:block text-align="right" font-style="italic">
1866
+ <xsl:text> </xsl:text>
1867
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1868
+ </fo:block>
1869
+ </fo:table-cell>
1870
+ </fo:table-row>
2347
1871
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2348
1872
  <fo:table-body>
2349
1873
  <xsl:apply-templates/>
@@ -2407,6 +1931,8 @@
2407
1931
  </xsl:choose>
2408
1932
  </xsl:variable>
2409
1933
 
1934
+
1935
+
2410
1936
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2411
1937
  <xsl:with-param name="cols-count" select="$cols-count"/>
2412
1938
  </xsl:apply-templates>
@@ -2416,6 +1942,8 @@
2416
1942
  </xsl:call-template>
2417
1943
 
2418
1944
  <fo:table-body>
1945
+
1946
+
2419
1947
  <xsl:apply-templates/>
2420
1948
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
2421
1949
 
@@ -2441,11 +1969,24 @@
2441
1969
  <xsl:attribute name="min-height">0mm</xsl:attribute>
2442
1970
  <xsl:attribute name="line-height">110%</xsl:attribute>
2443
1971
 
1972
+
1973
+
2444
1974
 
2445
1975
  <xsl:apply-templates/>
2446
1976
  </fo:table-row>
2447
1977
  </xsl:template><xsl:template match="*[local-name()='th']">
2448
1978
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1979
+ <xsl:attribute name="text-align">
1980
+ <xsl:choose>
1981
+ <xsl:when test="@align">
1982
+ <xsl:value-of select="@align"/>
1983
+ </xsl:when>
1984
+ <xsl:otherwise>center</xsl:otherwise>
1985
+ </xsl:choose>
1986
+ </xsl:attribute>
1987
+
1988
+
1989
+
2449
1990
 
2450
1991
 
2451
1992
 
@@ -2463,12 +2004,32 @@
2463
2004
  <xsl:value-of select="@rowspan"/>
2464
2005
  </xsl:attribute>
2465
2006
  </xsl:if>
2007
+ <xsl:call-template name="display-align"/>
2466
2008
  <fo:block>
2467
2009
  <xsl:apply-templates/>
2468
2010
  </fo:block>
2469
2011
  </fo:table-cell>
2012
+ </xsl:template><xsl:template name="display-align">
2013
+ <xsl:if test="@valign">
2014
+ <xsl:attribute name="display-align">
2015
+ <xsl:choose>
2016
+ <xsl:when test="@valign = 'top'">before</xsl:when>
2017
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
2018
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
2019
+ <xsl:otherwise>before</xsl:otherwise>
2020
+ </xsl:choose>
2021
+ </xsl:attribute>
2022
+ </xsl:if>
2470
2023
  </xsl:template><xsl:template match="*[local-name()='td']">
2471
2024
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2025
+ <xsl:attribute name="text-align">
2026
+ <xsl:choose>
2027
+ <xsl:when test="@align">
2028
+ <xsl:value-of select="@align"/>
2029
+ </xsl:when>
2030
+ <xsl:otherwise>left</xsl:otherwise>
2031
+ </xsl:choose>
2032
+ </xsl:attribute>
2472
2033
 
2473
2034
 
2474
2035
 
@@ -2476,6 +2037,7 @@
2476
2037
  <xsl:if test="ancestor::*[local-name() = 'tfoot']">
2477
2038
  <xsl:attribute name="border-bottom">solid black 0</xsl:attribute>
2478
2039
  </xsl:if>
2040
+
2479
2041
 
2480
2042
 
2481
2043
 
@@ -2492,24 +2054,12 @@
2492
2054
  <xsl:value-of select="@rowspan"/>
2493
2055
  </xsl:attribute>
2494
2056
  </xsl:if>
2495
- <fo:block>
2496
-
2057
+ <xsl:call-template name="display-align"/>
2058
+ <fo:block>
2497
2059
  <xsl:apply-templates/>
2498
- </fo:block>
2499
- <!-- <xsl:choose>
2500
- <xsl:when test="count(*) = 1 and *[local-name() = 'p']">
2501
- <xsl:apply-templates />
2502
- </xsl:when>
2503
- <xsl:otherwise>
2504
- <fo:block>
2505
- <xsl:apply-templates />
2506
- </fo:block>
2507
- </xsl:otherwise>
2508
- </xsl:choose> -->
2509
-
2510
-
2060
+ </fo:block>
2511
2061
  </fo:table-cell>
2512
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2062
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2513
2063
 
2514
2064
 
2515
2065
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2527,26 +2077,14 @@
2527
2077
 
2528
2078
 
2529
2079
 
2530
- <xsl:variable name="title-note">
2531
- <xsl:call-template name="getTitle">
2532
- <xsl:with-param name="name" select="'title-note'"/>
2533
- </xsl:call-template>
2534
- </xsl:variable>
2535
- <xsl:value-of select="$title-note"/>
2536
-
2537
- <xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
2538
- <xsl:if test="count(//*[local-name()='note'][ancestor::*[@id = $id]]) &gt; 1">
2539
- <xsl:number count="*[local-name()='note'][ancestor::*[@id = $id]]" level="any"/>
2540
- </xsl:if>
2541
- <xsl:text>:</xsl:text>
2542
-
2543
-
2544
-
2080
+
2081
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2082
+
2545
2083
  </fo:inline>
2546
2084
  <xsl:apply-templates mode="process"/>
2547
2085
  </fo:block>
2548
2086
 
2549
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2087
+ </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">
2550
2088
  <xsl:apply-templates/>
2551
2089
  </xsl:template><xsl:template name="fn_display">
2552
2090
  <xsl:variable name="references">
@@ -2612,7 +2150,7 @@
2612
2150
  true <!-- and (not(@class) or @class !='pseudocode') -->
2613
2151
  </xsl:variable>
2614
2152
  <xsl:variable name="references">
2615
- <xsl:for-each select=".//*[local-name()='fn']">
2153
+ <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2616
2154
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2617
2155
  <xsl:apply-templates/>
2618
2156
  </fn>
@@ -2710,6 +2248,7 @@
2710
2248
 
2711
2249
 
2712
2250
 
2251
+
2713
2252
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2714
2253
 
2715
2254
  <xsl:value-of select="@reference"/>
@@ -2720,139 +2259,155 @@
2720
2259
  <xsl:apply-templates/>
2721
2260
  </fo:inline>
2722
2261
  </xsl:template><xsl:template match="*[local-name()='dl']">
2723
- <xsl:variable name="parent" select="local-name(..)"/>
2724
-
2725
- <xsl:variable name="key_iso">
2726
-
2727
- <xsl:if test="$parent = 'figure' or $parent = 'formula'">true</xsl:if>
2728
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
2729
- </xsl:variable>
2730
-
2731
- <xsl:choose>
2732
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2262
+ <fo:block-container margin-left="0mm">
2263
+ <xsl:if test="parent::*[local-name() = 'note']">
2264
+ <xsl:attribute name="margin-left">
2265
+ <xsl:choose>
2266
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2267
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2268
+ </xsl:choose>
2269
+ </xsl:attribute>
2733
2270
 
2734
- <fo:block text-align="left">
2735
-
2736
-
2737
- <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
2738
-
2739
- <xsl:variable name="title-where">
2740
- <xsl:call-template name="getTitle">
2741
- <xsl:with-param name="name" select="'title-where'"/>
2742
- </xsl:call-template>
2743
- </xsl:variable>
2744
- <xsl:value-of select="$title-where"/>
2745
- </fo:block>
2746
- <fo:block>
2747
-
2748
- <xsl:attribute name="text-indent">7.4mm</xsl:attribute>
2749
-
2750
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2751
-
2752
- <xsl:text> </xsl:text>
2753
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2754
- </fo:block>
2271
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2755
2272
 
2273
+ </xsl:if>
2274
+ <fo:block-container margin-left="0mm">
2275
+
2276
+ <xsl:variable name="parent" select="local-name(..)"/>
2756
2277
 
2757
- </xsl:when>
2758
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2759
- <fo:block margin-bottom="12pt" text-align="left">
2760
-
2761
-
2762
-
2278
+ <xsl:variable name="key_iso">
2763
2279
 
2764
- <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
2765
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2766
-
2767
- <xsl:variable name="title-where">
2768
- <xsl:call-template name="getTitle">
2769
- <xsl:with-param name="name" select="'title-where'"/>
2770
- </xsl:call-template>
2771
- </xsl:variable>
2772
- <xsl:value-of select="$title-where"/>
2773
- </fo:block>
2774
- </xsl:when>
2775
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2776
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2777
-
2778
-
2779
-
2780
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2781
- <xsl:attribute name="text-indent">7.4mm</xsl:attribute>
2782
-
2783
- <xsl:variable name="title-key">
2784
- <xsl:call-template name="getTitle">
2785
- <xsl:with-param name="name" select="'title-key'"/>
2786
- </xsl:call-template>
2787
- </xsl:variable>
2788
- <xsl:value-of select="$title-key"/>
2789
- </fo:block>
2790
- </xsl:when>
2791
- </xsl:choose>
2792
-
2793
- <!-- a few components -->
2794
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2795
- <fo:block>
2796
-
2797
-
2280
+ <xsl:if test="$parent = 'figure' or $parent = 'formula'">true</xsl:if>
2281
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2282
+ </xsl:variable>
2798
2283
 
2284
+ <xsl:choose>
2285
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2286
+
2287
+ <fo:block text-align="left">
2288
+
2289
+
2290
+ <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
2291
+
2292
+ <xsl:variable name="title-where">
2293
+ <xsl:call-template name="getTitle">
2294
+ <xsl:with-param name="name" select="'title-where'"/>
2295
+ </xsl:call-template>
2296
+ </xsl:variable>
2297
+ <xsl:value-of select="$title-where"/>
2298
+ </fo:block>
2299
+ <fo:block>
2300
+
2301
+ <xsl:attribute name="text-indent">7.4mm</xsl:attribute>
2302
+
2303
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2304
+
2305
+ <xsl:text> </xsl:text>
2306
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2307
+ </fo:block>
2308
+
2309
+
2310
+ </xsl:when>
2311
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2312
+ <fo:block margin-bottom="12pt" text-align="left">
2313
+
2314
+
2315
+
2316
+
2317
+ <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
2318
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2319
+
2320
+ <xsl:variable name="title-where">
2321
+ <xsl:call-template name="getTitle">
2322
+ <xsl:with-param name="name" select="'title-where'"/>
2323
+ </xsl:call-template>
2324
+ </xsl:variable>
2325
+ <xsl:value-of select="$title-where"/>
2326
+ </fo:block>
2327
+ </xsl:when>
2328
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2329
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2330
+
2331
+
2332
+
2333
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2334
+ <xsl:attribute name="text-indent">7.4mm</xsl:attribute>
2335
+
2336
+ <xsl:variable name="title-key">
2337
+ <xsl:call-template name="getTitle">
2338
+ <xsl:with-param name="name" select="'title-key'"/>
2339
+ </xsl:call-template>
2340
+ </xsl:variable>
2341
+ <xsl:value-of select="$title-key"/>
2342
+ </fo:block>
2343
+ </xsl:when>
2344
+ </xsl:choose>
2799
2345
 
2800
- <fo:block>
2801
-
2802
-
2803
- <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
2804
- <xsl:if test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2805
- <xsl:attribute name="margin-left">15mm</xsl:attribute>
2806
- </xsl:if>
2807
-
2808
-
2809
-
2810
- <fo:table width="95%" table-layout="fixed">
2346
+ <!-- a few components -->
2347
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2348
+ <fo:block>
2811
2349
 
2812
- <xsl:attribute name="margin-left">-3.7mm</xsl:attribute>
2813
2350
 
2814
- <xsl:choose>
2815
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2816
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2817
- </xsl:when>
2818
- <xsl:when test="normalize-space($key_iso) = 'true'">
2819
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2351
+
2352
+
2353
+ <fo:block>
2354
+
2355
+
2356
+ <xsl:attribute name="margin-left">7.4mm</xsl:attribute>
2357
+ <xsl:if test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2358
+ <xsl:attribute name="margin-left">15mm</xsl:attribute>
2359
+ </xsl:if>
2360
+
2361
+
2362
+
2363
+ <fo:table width="95%" table-layout="fixed">
2820
2364
 
2821
- </xsl:when>
2822
- </xsl:choose>
2823
- <!-- create virtual html table for dl/[dt and dd] -->
2824
- <xsl:variable name="html-table">
2825
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2826
- <xsl:element name="{$ns}:table">
2827
- <tbody>
2828
- <xsl:apply-templates mode="dl"/>
2829
- </tbody>
2830
- </xsl:element>
2831
- </xsl:variable>
2832
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2833
- <xsl:variable name="colwidths">
2834
- <xsl:call-template name="calculate-column-widths">
2835
- <xsl:with-param name="cols-count" select="2"/>
2836
- <xsl:with-param name="table" select="$html-table"/>
2837
- </xsl:call-template>
2838
- </xsl:variable>
2839
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2840
- <xsl:variable name="maxlength_dt">
2841
- <xsl:call-template name="getMaxLength_dt"/>
2842
- </xsl:variable>
2843
- <xsl:call-template name="setColumnWidth_dl">
2844
- <xsl:with-param name="colwidths" select="$colwidths"/>
2845
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2846
- </xsl:call-template>
2847
- <fo:table-body>
2848
- <xsl:apply-templates>
2849
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2850
- </xsl:apply-templates>
2851
- </fo:table-body>
2852
- </fo:table>
2853
- </fo:block>
2854
- </fo:block>
2855
- </xsl:if>
2365
+ <xsl:attribute name="margin-left">-3.7mm</xsl:attribute>
2366
+
2367
+ <xsl:choose>
2368
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2369
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2370
+ </xsl:when>
2371
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2372
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2373
+
2374
+ </xsl:when>
2375
+ </xsl:choose>
2376
+ <!-- create virtual html table for dl/[dt and dd] -->
2377
+ <xsl:variable name="html-table">
2378
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2379
+ <xsl:element name="{$ns}:table">
2380
+ <tbody>
2381
+ <xsl:apply-templates mode="dl"/>
2382
+ </tbody>
2383
+ </xsl:element>
2384
+ </xsl:variable>
2385
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2386
+ <xsl:variable name="colwidths">
2387
+ <xsl:call-template name="calculate-column-widths">
2388
+ <xsl:with-param name="cols-count" select="2"/>
2389
+ <xsl:with-param name="table" select="$html-table"/>
2390
+ </xsl:call-template>
2391
+ </xsl:variable>
2392
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2393
+ <xsl:variable name="maxlength_dt">
2394
+ <xsl:call-template name="getMaxLength_dt"/>
2395
+ </xsl:variable>
2396
+ <xsl:call-template name="setColumnWidth_dl">
2397
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2398
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2399
+ </xsl:call-template>
2400
+ <fo:table-body>
2401
+ <xsl:apply-templates>
2402
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2403
+ </xsl:apply-templates>
2404
+ </fo:table-body>
2405
+ </fo:table>
2406
+ </fo:block>
2407
+ </fo:block>
2408
+ </xsl:if>
2409
+ </fo:block-container>
2410
+ </fo:block-container>
2856
2411
  </xsl:template><xsl:template name="setColumnWidth_dl">
2857
2412
  <xsl:param name="colwidths"/>
2858
2413
  <xsl:param name="maxlength_dt"/>
@@ -2907,7 +2462,7 @@
2907
2462
  <xsl:value-of select="string-length(normalize-space(.))"/>
2908
2463
  </xsl:if>
2909
2464
  </xsl:for-each>
2910
- </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
2465
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2911
2466
  <xsl:param name="key_iso"/>
2912
2467
 
2913
2468
  <!-- <tr>
@@ -2923,12 +2478,7 @@
2923
2478
  <xsl:if test="normalize-space($key_iso) = 'true'">
2924
2479
  <xsl:attribute name="margin-top">0</xsl:attribute>
2925
2480
  </xsl:if>
2926
- <xsl:variable name="title-note">
2927
- <xsl:call-template name="getTitle">
2928
- <xsl:with-param name="name" select="'title-note'"/>
2929
- </xsl:call-template>
2930
- </xsl:variable>
2931
- <xsl:value-of select="$title-note"/>
2481
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2932
2482
  </fo:block>
2933
2483
  </fo:table-cell>
2934
2484
  <fo:table-cell>
@@ -2954,6 +2504,7 @@
2954
2504
  <xsl:param name="key_iso"/>
2955
2505
 
2956
2506
  <fo:table-row>
2507
+
2957
2508
  <fo:table-cell>
2958
2509
 
2959
2510
  <fo:block margin-top="6pt">
@@ -2979,14 +2530,36 @@
2979
2530
  <fo:table-cell>
2980
2531
  <fo:block>
2981
2532
 
2982
-
2533
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2534
+ <xsl:if test="local-name(*[1]) != 'stem'">
2535
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2536
+ </xsl:if>
2537
+ </xsl:if> -->
2983
2538
 
2984
2539
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2985
2540
 
2986
2541
  </fo:block>
2987
2542
  </fo:table-cell>
2988
2543
  </fo:table-row>
2989
-
2544
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2545
+ <xsl:if test="local-name(*[1]) = 'stem'">
2546
+ <fo:table-row>
2547
+ <fo:table-cell>
2548
+ <fo:block margin-top="6pt">
2549
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2550
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2551
+ </xsl:if>
2552
+ <xsl:text>&#xA0;</xsl:text>
2553
+ </fo:block>
2554
+ </fo:table-cell>
2555
+ <fo:table-cell>
2556
+ <fo:block>
2557
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2558
+ </fo:block>
2559
+ </fo:table-cell>
2560
+ </fo:table-row>
2561
+ </xsl:if>
2562
+ </xsl:if> -->
2990
2563
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2991
2564
  <xsl:apply-templates/>
2992
2565
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2997,7 +2570,7 @@
2997
2570
  <fo:inline font-style="italic">
2998
2571
  <xsl:apply-templates/>
2999
2572
  </fo:inline>
3000
- </xsl:template><xsl:template match="*[local-name()='strong']">
2573
+ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
3001
2574
  <fo:inline font-weight="bold">
3002
2575
  <xsl:apply-templates/>
3003
2576
  </fo:inline>
@@ -3010,7 +2583,32 @@
3010
2583
  <xsl:apply-templates/>
3011
2584
  </fo:inline>
3012
2585
  </xsl:template><xsl:template match="*[local-name()='tt']">
3013
- <fo:inline font-family="Courier" font-size="10pt">
2586
+ <fo:inline xsl:use-attribute-sets="tt-style">
2587
+ <xsl:variable name="_font-size">
2588
+
2589
+
2590
+ 10
2591
+
2592
+
2593
+
2594
+
2595
+
2596
+
2597
+
2598
+
2599
+
2600
+
2601
+
2602
+ </xsl:variable>
2603
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2604
+ <xsl:if test="$font-size != ''">
2605
+ <xsl:attribute name="font-size">
2606
+ <xsl:choose>
2607
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2608
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2609
+ </xsl:choose>
2610
+ </xsl:attribute>
2611
+ </xsl:if>
3014
2612
  <xsl:apply-templates/>
3015
2613
  </fo:inline>
3016
2614
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -3337,121 +2935,1060 @@
3337
2935
  <xsl:value-of select="substring($str, 2)"/>
3338
2936
  </xsl:template><xsl:template match="mathml:math">
3339
2937
  <fo:inline font-family="STIX2Math">
3340
- <fo:instream-foreign-object fox:alt-text="Math">
3341
- <xsl:copy-of select="."/>
3342
- </fo:instream-foreign-object>
2938
+ <xsl:variable name="mathml">
2939
+ <xsl:apply-templates select="." mode="mathml"/>
2940
+ </xsl:variable>
2941
+ <fo:instream-foreign-object fox:alt-text="Math">
2942
+ <!-- <xsl:copy-of select="."/> -->
2943
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2944
+ </fo:instream-foreign-object>
3343
2945
  </fo:inline>
3344
- </xsl:template><xsl:template match="*[local-name()='localityStack']">
3345
- <xsl:for-each select="*[local-name()='locality']">
3346
- <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
3347
- <xsl:apply-templates select="."/>
3348
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
3349
- </xsl:for-each>
3350
- </xsl:template><xsl:template match="*[local-name()='link']" name="link">
2946
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2947
+ <xsl:copy>
2948
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2949
+ </xsl:copy>
2950
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2951
+ <xsl:copy>
2952
+ <!-- replace start and end spaces to non-break space -->
2953
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2954
+ </xsl:copy>
2955
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3351
2956
  <xsl:variable name="target">
3352
2957
  <xsl:choose>
3353
2958
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3354
2959
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
3355
2960
  </xsl:when>
3356
- <xsl:otherwise>
3357
- <xsl:value-of select="normalize-space(@target)"/>
2961
+ <xsl:otherwise>
2962
+ <xsl:value-of select="normalize-space(@target)"/>
2963
+ </xsl:otherwise>
2964
+ </xsl:choose>
2965
+ </xsl:variable>
2966
+ <fo:inline xsl:use-attribute-sets="link-style">
2967
+ <xsl:choose>
2968
+ <xsl:when test="$target = ''">
2969
+ <xsl:apply-templates/>
2970
+ </xsl:when>
2971
+ <xsl:otherwise>
2972
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2973
+ <xsl:choose>
2974
+ <xsl:when test="normalize-space(.) = ''">
2975
+ <xsl:value-of select="$target"/>
2976
+ </xsl:when>
2977
+ <xsl:otherwise>
2978
+ <xsl:apply-templates/>
2979
+ </xsl:otherwise>
2980
+ </xsl:choose>
2981
+ </fo:basic-link>
2982
+ </xsl:otherwise>
2983
+ </xsl:choose>
2984
+ </fo:inline>
2985
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
2986
+ <fo:inline id="{@id}"/>
2987
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
2988
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
2989
+ <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
2990
+ </fo:block>
2991
+ <xsl:apply-templates/>
2992
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
2993
+ <fo:inline><xsl:apply-templates/></fo:inline>
2994
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
2995
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
2996
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2997
+ </fo:block>
2998
+ <xsl:apply-templates/>
2999
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
3000
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3001
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3002
+ <xsl:variable name="annotation-id" select="@id"/>
3003
+ <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3004
+ <fo:block id="{$annotation-id}" white-space="nowrap">
3005
+ <fo:inline>
3006
+ <xsl:apply-templates>
3007
+ <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3008
+ </xsl:apply-templates>
3009
+ </fo:inline>
3010
+ </fo:block>
3011
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3012
+ <xsl:param name="callout"/>
3013
+ <fo:inline id="{@id}">
3014
+ <!-- for first p in annotation, put <x> -->
3015
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3016
+ <xsl:apply-templates/>
3017
+ </fo:inline>
3018
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
3019
+ <xsl:variable name="title-modified">
3020
+ <xsl:call-template name="getTitle">
3021
+ <xsl:with-param name="name" select="'title-modified'"/>
3022
+ </xsl:call-template>
3023
+ </xsl:variable>
3024
+ <xsl:choose>
3025
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3026
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3027
+ </xsl:choose>
3028
+ <xsl:apply-templates/>
3029
+ </xsl:template><xsl:template match="*[local-name() = 'xref']">
3030
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3031
+
3032
+ <xsl:apply-templates/>
3033
+ </fo:basic-link>
3034
+ </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
3035
+ <fo:block-container margin-left="0mm">
3036
+ <xsl:if test="parent::*[local-name() = 'note']">
3037
+ <xsl:attribute name="margin-left">
3038
+ <xsl:choose>
3039
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3040
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3041
+ </xsl:choose>
3042
+ </xsl:attribute>
3043
+
3044
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3045
+
3046
+ </xsl:if>
3047
+ <fo:block-container margin-left="0mm">
3048
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3049
+ <xsl:apply-templates/>
3050
+ </fo:block>
3051
+ </fo:block-container>
3052
+ </fo:block-container>
3053
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
3054
+ <fo:inline>
3055
+ <xsl:apply-templates/>
3056
+ </fo:inline>
3057
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
3058
+ <fo:inline>
3059
+ <xsl:apply-templates/>
3060
+ </fo:inline>
3061
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
3062
+ <xsl:if test="normalize-space() != ''">
3063
+ <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
3064
+ </xsl:if>
3065
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
3066
+
3067
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
3068
+
3069
+
3070
+
3071
+
3072
+ <fo:block-container margin-left="0mm">
3073
+
3074
+ <fo:table table-layout="fixed" width="100%">
3075
+ <fo:table-column column-width="10mm"/>
3076
+ <fo:table-column column-width="155mm"/>
3077
+ <fo:table-body>
3078
+ <fo:table-row>
3079
+ <fo:table-cell>
3080
+ <fo:block font-family="SimHei" xsl:use-attribute-sets="note-name-style">
3081
+ <xsl:apply-templates select="gb:name" mode="presentation"/>
3082
+ </fo:block>
3083
+ </fo:table-cell>
3084
+ <fo:table-cell>
3085
+ <fo:block text-align="justify">
3086
+ <xsl:apply-templates/>
3087
+ </fo:block>
3088
+ </fo:table-cell>
3089
+ </fo:table-row>
3090
+ </fo:table-body>
3091
+ </fo:table>
3092
+
3093
+
3094
+
3095
+
3096
+
3097
+
3098
+
3099
+
3100
+
3101
+ </fo:block-container>
3102
+ </fo:block-container>
3103
+
3104
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
3105
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
3106
+ <xsl:choose>
3107
+ <xsl:when test="$num = 1">
3108
+ <fo:inline xsl:use-attribute-sets="note-p-style">
3109
+ <xsl:apply-templates/>
3110
+ </fo:inline>
3111
+ </xsl:when>
3112
+ <xsl:otherwise>
3113
+ <fo:block xsl:use-attribute-sets="note-p-style">
3114
+ <xsl:apply-templates/>
3115
+ </fo:block>
3116
+ </xsl:otherwise>
3117
+ </xsl:choose>
3118
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3119
+ <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3120
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3121
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3122
+ </fo:inline>
3123
+ <xsl:apply-templates/>
3124
+ </fo:block>
3125
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
3126
+ <xsl:param name="sfx"/>
3127
+ <xsl:variable name="suffix">
3128
+ <xsl:choose>
3129
+ <xsl:when test="$sfx != ''">
3130
+ <xsl:value-of select="$sfx"/>
3131
+ </xsl:when>
3132
+ <xsl:otherwise>
3133
+
3134
+ <xsl:text>:</xsl:text>
3135
+
3136
+
3137
+ </xsl:otherwise>
3138
+ </xsl:choose>
3139
+ </xsl:variable>
3140
+ <xsl:if test="normalize-space() != ''">
3141
+ <xsl:apply-templates/>
3142
+ <xsl:value-of select="$suffix"/>
3143
+ </xsl:if>
3144
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
3145
+ <xsl:param name="sfx"/>
3146
+ <xsl:variable name="suffix">
3147
+ <xsl:choose>
3148
+ <xsl:when test="$sfx != ''">
3149
+ <xsl:value-of select="$sfx"/>
3150
+ </xsl:when>
3151
+ <xsl:otherwise>
3152
+
3153
+ <xsl:text>:</xsl:text>
3154
+
3155
+
3156
+ </xsl:otherwise>
3157
+ </xsl:choose>
3158
+ </xsl:variable>
3159
+ <xsl:if test="normalize-space() != ''">
3160
+ <xsl:apply-templates/>
3161
+ <xsl:value-of select="$suffix"/>
3162
+ </xsl:if>
3163
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
3164
+ <fo:inline><xsl:apply-templates/></fo:inline>
3165
+ </xsl:template><xsl:template match="*[local-name() = 'terms']">
3166
+ <fo:block id="{@id}">
3167
+ <xsl:apply-templates/>
3168
+ </fo:block>
3169
+ </xsl:template><xsl:template match="*[local-name() = 'term']">
3170
+ <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
3171
+
3172
+ <fo:block font-family="SimHei" font-size="11pt" keep-with-next="always" margin-top="10pt" margin-bottom="8pt" line-height="1.1">
3173
+ <xsl:apply-templates select="gb:name" mode="presentation"/>
3174
+ </fo:block>
3175
+
3176
+
3177
+
3178
+ <xsl:apply-templates/>
3179
+ </fo:block>
3180
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3181
+ <xsl:if test="normalize-space() != ''">
3182
+ <fo:inline>
3183
+ <xsl:apply-templates/>
3184
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3185
+ <xsl:text>.</xsl:text>
3186
+ </xsl:if> -->
3187
+ </fo:inline>
3188
+ </xsl:if>
3189
+ </xsl:template><xsl:template match="*[local-name() = 'figure']">
3190
+ <fo:block-container id="{@id}">
3191
+ <fo:block>
3192
+ <xsl:apply-templates/>
3193
+ </fo:block>
3194
+ <xsl:call-template name="fn_display_figure"/>
3195
+ <xsl:for-each select="*[local-name() = 'note']">
3196
+ <xsl:call-template name="note"/>
3197
+ </xsl:for-each>
3198
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3199
+ </fo:block-container>
3200
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3201
+ <fo:block id="{@id}">
3202
+ <xsl:apply-templates/>
3203
+ </fo:block>
3204
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3205
+ <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3206
+ <xsl:apply-templates/>
3207
+ </fo:block>
3208
+ </xsl:template><xsl:template match="*[local-name() = 'image']">
3209
+ <fo:block xsl:use-attribute-sets="image-style">
3210
+
3211
+
3212
+ <xsl:variable name="src">
3213
+ <xsl:choose>
3214
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3215
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3216
+ </xsl:when>
3217
+ <xsl:otherwise>
3218
+ <xsl:value-of select="@src"/>
3219
+ </xsl:otherwise>
3220
+ </xsl:choose>
3221
+ </xsl:variable>
3222
+
3223
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3224
+ </fo:block>
3225
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
3226
+ <xsl:apply-templates mode="contents"/>
3227
+ <xsl:text> </xsl:text>
3228
+ </xsl:template><xsl:template match="text()" mode="contents">
3229
+ <xsl:value-of select="."/>
3230
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3231
+ <xsl:if test="normalize-space() != ''">
3232
+ <fo:block xsl:use-attribute-sets="figure-name-style">
3233
+
3234
+ <xsl:apply-templates/>
3235
+ </fo:block>
3236
+ </xsl:if>
3237
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
3238
+ <xsl:apply-templates mode="contents_item"/>
3239
+ <!-- <xsl:text> </xsl:text> -->
3240
+ </xsl:template><xsl:template name="getSection">
3241
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3242
+ </xsl:template><xsl:template name="getName">
3243
+ <xsl:choose>
3244
+ <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
3245
+ <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
3246
+ </xsl:when>
3247
+ <xsl:otherwise>
3248
+ <xsl:copy-of select="*[local-name() = 'title']/node()"/>
3249
+ </xsl:otherwise>
3250
+ </xsl:choose>
3251
+ </xsl:template><xsl:template name="insertTitleAsListItem">
3252
+ <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
3253
+ <xsl:variable name="section">
3254
+ <xsl:for-each select="..">
3255
+ <xsl:call-template name="getSection"/>
3256
+ </xsl:for-each>
3257
+ </xsl:variable>
3258
+ <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
3259
+ <fo:list-item>
3260
+ <fo:list-item-label end-indent="label-end()">
3261
+ <fo:block>
3262
+ <xsl:value-of select="$section"/>
3263
+ </fo:block>
3264
+ </fo:list-item-label>
3265
+ <fo:list-item-body start-indent="body-start()">
3266
+ <fo:block>
3267
+ <xsl:choose>
3268
+ <xsl:when test="*[local-name() = 'tab']">
3269
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3270
+ </xsl:when>
3271
+ <xsl:otherwise>
3272
+ <xsl:apply-templates/>
3273
+ </xsl:otherwise>
3274
+ </xsl:choose>
3275
+ </fo:block>
3276
+ </fo:list-item-body>
3277
+ </fo:list-item>
3278
+ </fo:list-block>
3279
+ </xsl:template><xsl:template name="extractTitle">
3280
+ <xsl:choose>
3281
+ <xsl:when test="*[local-name() = 'tab']">
3282
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3283
+ </xsl:when>
3284
+ <xsl:otherwise>
3285
+ <xsl:apply-templates/>
3286
+ </xsl:otherwise>
3287
+ </xsl:choose>
3288
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3289
+ <xsl:text> </xsl:text>
3290
+ </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3291
+ <xsl:copy>
3292
+ <xsl:apply-templates mode="contents_item"/>
3293
+ </xsl:copy>
3294
+ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3295
+ <xsl:text> </xsl:text>
3296
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3297
+
3298
+ <fo:block-container margin-left="0mm">
3299
+ <xsl:if test="parent::*[local-name() = 'note']">
3300
+ <xsl:attribute name="margin-left">
3301
+ <xsl:choose>
3302
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3303
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3304
+ </xsl:choose>
3305
+ </xsl:attribute>
3306
+
3307
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3308
+
3309
+ </xsl:if>
3310
+ <fo:block-container margin-left="0mm">
3311
+
3312
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3313
+ <xsl:variable name="_font-size">
3314
+
3315
+
3316
+ 9
3317
+
3318
+
3319
+
3320
+
3321
+
3322
+
3323
+
3324
+
3325
+
3326
+
3327
+
3328
+ </xsl:variable>
3329
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3330
+ <xsl:if test="$font-size != ''">
3331
+ <xsl:attribute name="font-size">
3332
+ <xsl:choose>
3333
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3334
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3335
+ </xsl:choose>
3336
+ </xsl:attribute>
3337
+ </xsl:if>
3338
+ <xsl:apply-templates/>
3339
+ </fo:block>
3340
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3341
+
3342
+ </fo:block-container>
3343
+ </fo:block-container>
3344
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
3345
+ <xsl:variable name="text">
3346
+ <xsl:call-template name="add-zero-spaces-equal"/>
3347
+ </xsl:variable>
3348
+ <xsl:call-template name="add-zero-spaces-java">
3349
+ <xsl:with-param name="text" select="$text"/>
3350
+ </xsl:call-template>
3351
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3352
+ <xsl:if test="normalize-space() != ''">
3353
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3354
+ <xsl:apply-templates/>
3355
+ </fo:block>
3356
+ </xsl:if>
3357
+ </xsl:template><xsl:template match="*[local-name() = 'permission']">
3358
+ <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3359
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3360
+ <xsl:apply-templates/>
3361
+ </fo:block>
3362
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
3363
+ <xsl:if test="normalize-space() != ''">
3364
+ <fo:block xsl:use-attribute-sets="permission-name-style">
3365
+ <xsl:apply-templates/>
3366
+
3367
+ </fo:block>
3368
+ </xsl:if>
3369
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
3370
+ <fo:block xsl:use-attribute-sets="permission-label-style">
3371
+ <xsl:apply-templates/>
3372
+ </fo:block>
3373
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']">
3374
+ <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3375
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3376
+ <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
3377
+ <xsl:apply-templates select="@obligation" mode="presentation"/>
3378
+ <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
3379
+ <xsl:apply-templates/>
3380
+ </fo:block>
3381
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
3382
+ <xsl:if test="normalize-space() != ''">
3383
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
3384
+
3385
+ <xsl:apply-templates/>
3386
+
3387
+ </fo:block>
3388
+ </xsl:if>
3389
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
3390
+ <fo:block xsl:use-attribute-sets="requirement-label-style">
3391
+ <xsl:apply-templates/>
3392
+ </fo:block>
3393
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
3394
+ <fo:block>
3395
+ <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
3396
+ </fo:block>
3397
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
3398
+ <fo:block xsl:use-attribute-sets="requirement-subject-style">
3399
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
3400
+ </fo:block>
3401
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
3402
+ <fo:block xsl:use-attribute-sets="requirement-inherit-style">
3403
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
3404
+ </fo:block>
3405
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
3406
+ <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3407
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3408
+ <xsl:apply-templates/>
3409
+ </fo:block>
3410
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
3411
+ <xsl:if test="normalize-space() != ''">
3412
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
3413
+ <xsl:apply-templates/>
3414
+
3415
+ </fo:block>
3416
+ </xsl:if>
3417
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
3418
+ <fo:block xsl:use-attribute-sets="recommendation-label-style">
3419
+ <xsl:apply-templates/>
3420
+ </fo:block>
3421
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3422
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3423
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3424
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3425
+ </xsl:if>
3426
+ <fo:block-container margin-left="0mm" margin-right="0mm">
3427
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3428
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3429
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3430
+ </xsl:if>
3431
+ <xsl:variable name="simple-table">
3432
+ <xsl:call-template name="getSimpleTable"/>
3433
+ </xsl:variable>
3434
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3435
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3436
+ <!-- <fo:table-column column-width="35mm"/>
3437
+ <fo:table-column column-width="115mm"/> -->
3438
+ <fo:table-column column-width="30%"/>
3439
+ <fo:table-column column-width="70%"/>
3440
+ </xsl:if>
3441
+ <xsl:apply-templates mode="requirement"/>
3442
+ </fo:table>
3443
+ <!-- fn processing -->
3444
+ <xsl:if test=".//*[local-name() = 'fn']">
3445
+ <xsl:for-each select="*[local-name() = 'tbody']">
3446
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3447
+ <xsl:call-template name="fn_display"/>
3448
+ </fo:block>
3449
+ </xsl:for-each>
3450
+ </xsl:if>
3451
+ </fo:block-container>
3452
+ </fo:block-container>
3453
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3454
+ <fo:table-header>
3455
+ <xsl:apply-templates mode="requirement"/>
3456
+ </fo:table-header>
3457
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3458
+ <fo:table-body>
3459
+ <xsl:apply-templates mode="requirement"/>
3460
+ </fo:table-body>
3461
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3462
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3463
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3464
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3465
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3466
+ </xsl:if>
3467
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3468
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3469
+ </xsl:if>
3470
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3471
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3472
+ </xsl:if>
3473
+ <xsl:apply-templates mode="requirement"/>
3474
+ </fo:table-row>
3475
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3476
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3477
+ <xsl:attribute name="text-align">
3478
+ <xsl:choose>
3479
+ <xsl:when test="@align">
3480
+ <xsl:value-of select="@align"/>
3481
+ </xsl:when>
3482
+ <xsl:otherwise>left</xsl:otherwise>
3483
+ </xsl:choose>
3484
+ </xsl:attribute>
3485
+ <xsl:if test="@colspan">
3486
+ <xsl:attribute name="number-columns-spanned">
3487
+ <xsl:value-of select="@colspan"/>
3488
+ </xsl:attribute>
3489
+ </xsl:if>
3490
+ <xsl:if test="@rowspan">
3491
+ <xsl:attribute name="number-rows-spanned">
3492
+ <xsl:value-of select="@rowspan"/>
3493
+ </xsl:attribute>
3494
+ </xsl:if>
3495
+ <xsl:call-template name="display-align"/>
3496
+
3497
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3498
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3499
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3500
+ </xsl:if>
3501
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3502
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3503
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3504
+ </xsl:if> -->
3505
+
3506
+ <fo:block>
3507
+ <xsl:apply-templates/>
3508
+ </fo:block>
3509
+ </fo:table-cell>
3510
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3511
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3512
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3513
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3514
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3515
+ </xsl:if>
3516
+ <xsl:attribute name="text-align">
3517
+ <xsl:choose>
3518
+ <xsl:when test="@align">
3519
+ <xsl:value-of select="@align"/>
3520
+ </xsl:when>
3521
+ <xsl:otherwise>left</xsl:otherwise>
3522
+ </xsl:choose>
3523
+ </xsl:attribute>
3524
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3525
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3526
+ </xsl:if>
3527
+ <xsl:if test="@colspan">
3528
+ <xsl:attribute name="number-columns-spanned">
3529
+ <xsl:value-of select="@colspan"/>
3530
+ </xsl:attribute>
3531
+ </xsl:if>
3532
+ <xsl:if test="@rowspan">
3533
+ <xsl:attribute name="number-rows-spanned">
3534
+ <xsl:value-of select="@rowspan"/>
3535
+ </xsl:attribute>
3536
+ </xsl:if>
3537
+ <xsl:call-template name="display-align"/>
3538
+
3539
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3540
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3541
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3542
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3543
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3544
+ </xsl:if>
3545
+ </xsl:if> -->
3546
+ <!-- 2nd line and below -->
3547
+
3548
+ <fo:block>
3549
+ <xsl:apply-templates/>
3550
+ </fo:block>
3551
+ </fo:table-cell>
3552
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3553
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3554
+ <xsl:apply-templates/>
3555
+ </fo:block>
3556
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3557
+ <fo:block> <!-- margin-bottom="10pt" -->
3558
+ <xsl:apply-templates/>
3559
+ </fo:block>
3560
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']">
3561
+ <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
3562
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3563
+ <xsl:apply-templates/>
3564
+ </fo:block>
3565
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
3566
+ <xsl:if test="normalize-space() != ''">
3567
+ <fo:inline xsl:use-attribute-sets="termexample-name-style">
3568
+ <xsl:apply-templates/>
3569
+ </fo:inline>
3570
+ </xsl:if>
3571
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
3572
+ <fo:inline><xsl:apply-templates/></fo:inline>
3573
+ </xsl:template><xsl:template match="*[local-name() = 'example']">
3574
+ <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
3575
+
3576
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3577
+
3578
+ <xsl:variable name="element">
3579
+ block
3580
+
3581
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3582
+ </xsl:variable>
3583
+
3584
+ <xsl:choose>
3585
+ <xsl:when test="contains(normalize-space($element), 'block')">
3586
+ <fo:block xsl:use-attribute-sets="example-body-style">
3587
+ <xsl:apply-templates/>
3588
+ </fo:block>
3589
+ </xsl:when>
3590
+ <xsl:otherwise>
3591
+ <fo:inline>
3592
+ <xsl:apply-templates/>
3593
+ </fo:inline>
3594
+ </xsl:otherwise>
3595
+ </xsl:choose>
3596
+
3597
+ </fo:block>
3598
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
3599
+
3600
+ <xsl:variable name="element">
3601
+
3602
+ inline
3603
+ </xsl:variable>
3604
+ <xsl:choose>
3605
+ <xsl:when test="ancestor::*[local-name() = 'appendix']">
3606
+ <fo:inline>
3607
+ <xsl:apply-templates/>
3608
+ </fo:inline>
3609
+ </xsl:when>
3610
+ <xsl:when test="normalize-space($element) = 'block'">
3611
+ <fo:block xsl:use-attribute-sets="example-name-style">
3612
+ <xsl:apply-templates/>
3613
+ </fo:block>
3614
+ </xsl:when>
3615
+ <xsl:otherwise>
3616
+ <fo:inline xsl:use-attribute-sets="example-name-style">
3617
+ <xsl:apply-templates/>
3618
+ </fo:inline>
3619
+ </xsl:otherwise>
3620
+ </xsl:choose>
3621
+
3622
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3623
+
3624
+ <xsl:variable name="element">
3625
+ block
3626
+
3627
+ </xsl:variable>
3628
+ <xsl:choose>
3629
+ <xsl:when test="normalize-space($element) = 'block'">
3630
+ <fo:block xsl:use-attribute-sets="example-p-style">
3631
+
3632
+ <xsl:apply-templates/>
3633
+ </fo:block>
3634
+ </xsl:when>
3635
+ <xsl:otherwise>
3636
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3637
+ <xsl:apply-templates/>
3638
+ </fo:inline>
3639
+ </xsl:otherwise>
3640
+ </xsl:choose>
3641
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3642
+ <fo:block xsl:use-attribute-sets="termsource-style">
3643
+ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3644
+ <xsl:variable name="termsource_text">
3645
+ <xsl:apply-templates/>
3646
+ </xsl:variable>
3647
+
3648
+ <xsl:choose>
3649
+ <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3650
+ <xsl:apply-templates/>
3651
+ </xsl:when>
3652
+ <xsl:otherwise>
3653
+
3654
+ <xsl:text>[</xsl:text>
3655
+
3656
+ <xsl:apply-templates/>
3657
+
3658
+ <xsl:text>]</xsl:text>
3659
+
3358
3660
  </xsl:otherwise>
3359
3661
  </xsl:choose>
3662
+ </fo:block>
3663
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
3664
+ <xsl:if test="normalize-space() != ''">
3665
+ <xsl:value-of select="."/>
3666
+ </xsl:if>
3667
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
3668
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3669
+
3670
+ <fo:inline xsl:use-attribute-sets="origin-style">
3671
+ <xsl:apply-templates/>
3672
+ </fo:inline>
3673
+ </fo:basic-link>
3674
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3675
+ <fo:inline><xsl:apply-templates/></fo:inline>
3676
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
3677
+ <xsl:if test="normalize-space() != ''">
3678
+ <xsl:value-of select="."/>
3679
+ </xsl:if>
3680
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3681
+ <fo:block-container margin-left="0mm">
3682
+ <xsl:if test="parent::*[local-name() = 'note']">
3683
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3684
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3685
+ </xsl:if>
3686
+ </xsl:if>
3687
+
3688
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3689
+
3690
+ <fo:block-container margin-left="0mm">
3691
+
3692
+ <fo:block xsl:use-attribute-sets="quote-style">
3693
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3694
+ </fo:block>
3695
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3696
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3697
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3698
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3699
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3700
+ </fo:block>
3701
+ </xsl:if>
3702
+
3703
+ </fo:block-container>
3704
+ </fo:block-container>
3705
+ </xsl:template><xsl:template match="*[local-name() = 'source']">
3706
+ <xsl:if test="../*[local-name() = 'author']">
3707
+ <xsl:text>, </xsl:text>
3708
+ </xsl:if>
3709
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3710
+ <xsl:apply-templates/>
3711
+ </fo:basic-link>
3712
+ </xsl:template><xsl:template match="*[local-name() = 'author']">
3713
+ <xsl:text>— </xsl:text>
3714
+ <xsl:apply-templates/>
3715
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
3716
+ <fo:inline xsl:use-attribute-sets="eref-style">
3717
+ <xsl:if test="@type = 'footnote'">
3718
+
3719
+
3720
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3721
+ <xsl:attribute name="font-size">50%</xsl:attribute>
3722
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3723
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3724
+
3725
+ </xsl:if>
3726
+
3727
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3728
+
3729
+ <xsl:if test="@type = 'inline'">
3730
+
3731
+
3732
+
3733
+ </xsl:if>
3734
+
3735
+
3736
+ <xsl:apply-templates/>
3737
+ </fo:basic-link>
3738
+ </fo:inline>
3739
+ </xsl:template><xsl:template match="*[local-name() = 'tab']">
3740
+ <!-- zero-space char -->
3741
+ <xsl:variable name="depth">
3742
+ <xsl:call-template name="getLevel">
3743
+ <xsl:with-param name="depth" select="../@depth"/>
3744
+ </xsl:call-template>
3360
3745
  </xsl:variable>
3361
- <fo:inline xsl:use-attribute-sets="link-style">
3746
+
3747
+ <xsl:variable name="padding">
3748
+
3749
+
3750
+ 3
3751
+
3752
+
3753
+
3754
+
3755
+
3756
+
3757
+
3758
+
3759
+
3760
+
3761
+
3762
+
3763
+
3764
+
3765
+
3766
+ </xsl:variable>
3767
+
3768
+ <xsl:variable name="padding-right">
3362
3769
  <xsl:choose>
3363
- <xsl:when test="$target = ''">
3364
- <xsl:apply-templates/>
3365
- </xsl:when>
3770
+ <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
3366
3771
  <xsl:otherwise>
3367
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3368
- <xsl:choose>
3369
- <xsl:when test="normalize-space(.) = ''">
3370
- <xsl:value-of select="$target"/>
3371
- </xsl:when>
3372
- <xsl:otherwise>
3373
- <xsl:apply-templates/>
3374
- </xsl:otherwise>
3375
- </xsl:choose>
3376
- </fo:basic-link>
3772
+ <xsl:value-of select="normalize-space($padding)"/>
3377
3773
  </xsl:otherwise>
3378
3774
  </xsl:choose>
3379
- </fo:inline>
3380
- </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3381
- <fo:block xsl:use-attribute-sets="sourcecode-style">
3382
- <!-- <xsl:choose>
3383
- <xsl:when test="@lang = 'en'"></xsl:when>
3384
- <xsl:otherwise> -->
3385
- <xsl:attribute name="white-space">pre</xsl:attribute>
3386
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
3387
- <!-- </xsl:otherwise>
3388
- </xsl:choose> -->
3775
+ </xsl:variable>
3776
+
3777
+ <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3778
+
3779
+ <xsl:choose>
3780
+ <xsl:when test="$language = 'zh'">
3781
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3782
+ </xsl:when>
3783
+ <xsl:when test="../../@inline-header = 'true'">
3784
+ <fo:inline font-size="90%">
3785
+ <xsl:call-template name="insertNonBreakSpaces">
3786
+ <xsl:with-param name="count" select="$padding-right"/>
3787
+ </xsl:call-template>
3788
+ </fo:inline>
3789
+ </xsl:when>
3790
+ <xsl:otherwise>
3791
+ <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
3792
+ </xsl:otherwise>
3793
+ </xsl:choose>
3794
+
3795
+ </xsl:template><xsl:template name="insertNonBreakSpaces">
3796
+ <xsl:param name="count"/>
3797
+ <xsl:if test="$count &gt; 0">
3798
+ <xsl:text> </xsl:text>
3799
+ <xsl:call-template name="insertNonBreakSpaces">
3800
+ <xsl:with-param name="count" select="$count - 1"/>
3801
+ </xsl:call-template>
3802
+ </xsl:if>
3803
+ </xsl:template><xsl:template match="*[local-name() = 'domain']">
3804
+ <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
3805
+ <xsl:text> </xsl:text>
3806
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']">
3807
+ <fo:block xsl:use-attribute-sets="admitted-style">
3389
3808
  <xsl:apply-templates/>
3390
3809
  </fo:block>
3391
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3392
- <fo:inline id="{@id}"/>
3393
- </xsl:template><xsl:template match="*[local-name()='appendix']">
3394
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3395
- <xsl:variable name="title-appendix">
3396
- <xsl:call-template name="getTitle">
3397
- <xsl:with-param name="name" select="'title-appendix'"/>
3398
- </xsl:call-template>
3399
- </xsl:variable>
3400
- <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3401
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3810
+ </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3811
+ <xsl:variable name="title-deprecated">
3812
+ <xsl:call-template name="getTitle">
3813
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3814
+ </xsl:call-template>
3815
+ </xsl:variable>
3816
+ <fo:block xsl:use-attribute-sets="deprecates-style">
3817
+ <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
3818
+ </fo:block>
3819
+ </xsl:template><xsl:template match="*[local-name() = 'definition']">
3820
+ <fo:block xsl:use-attribute-sets="definition-style">
3821
+ <xsl:apply-templates/>
3402
3822
  </fo:block>
3823
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
3403
3824
  <xsl:apply-templates/>
3404
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3405
- <fo:inline><xsl:apply-templates/></fo:inline>
3406
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3407
- <fo:block xsl:use-attribute-sets="appendix-example-style">
3408
- <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3409
- <xsl:variable name="title-example">
3410
- <xsl:call-template name="getTitle">
3411
- <xsl:with-param name="name" select="'title-example'"/>
3412
- </xsl:call-template>
3413
- </xsl:variable>
3414
- <xsl:value-of select="$title-example"/>
3415
- <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3416
- <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
3825
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
3826
+ <fo:inline> <xsl:apply-templates/></fo:inline>
3827
+ <fo:block> </fo:block>
3828
+ </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
3829
+
3830
+ <fo:block>
3831
+ <xsl:call-template name="setId"/>
3832
+
3833
+
3834
+
3835
+ <xsl:variable name="pos"><xsl:number count="gb:sections/gb:clause | gb:sections/gb:terms"/></xsl:variable>
3836
+ <xsl:if test="$pos &gt;= 2">
3837
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
3417
3838
  </xsl:if>
3418
- <xsl:if test="*[local-name()='name']">
3419
- <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
3420
- </xsl:if>
3839
+
3840
+
3841
+
3842
+
3843
+
3844
+
3845
+
3846
+
3847
+ <xsl:apply-templates/>
3848
+ </fo:block>
3849
+
3850
+
3851
+
3852
+ </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3853
+ <fo:block break-after="page"/>
3854
+ <fo:block>
3855
+ <xsl:call-template name="setId"/>
3856
+ <xsl:apply-templates/>
3857
+ </fo:block>
3858
+ </xsl:template><xsl:template match="*[local-name() = 'clause']">
3859
+ <fo:block>
3860
+ <xsl:call-template name="setId"/>
3861
+ <xsl:apply-templates/>
3862
+ </fo:block>
3863
+ </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3864
+ <fo:block id="{@id}">
3865
+ <xsl:apply-templates/>
3866
+ </fo:block>
3867
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3868
+
3869
+ <fo:block id="{@id}">
3870
+ <xsl:apply-templates/>
3871
+ </fo:block>
3872
+ </xsl:template><xsl:template match="*[local-name() = 'annex']">
3873
+ <fo:block break-after="page"/>
3874
+ <fo:block id="{@id}">
3875
+
3421
3876
  </fo:block>
3422
3877
  <xsl:apply-templates/>
3423
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process">
3424
- <fo:inline><xsl:apply-templates/></fo:inline>
3425
- </xsl:template><xsl:template match="*[local-name() = 'callout']">
3426
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3427
- </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3428
- <xsl:variable name="annotation-id" select="@id"/>
3429
- <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3430
- <fo:block id="{$annotation-id}" white-space="nowrap">
3431
- <fo:inline>
3432
- <xsl:apply-templates>
3433
- <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3434
- </xsl:apply-templates>
3435
- </fo:inline>
3436
- </fo:block>
3437
- </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3438
- <xsl:param name="callout"/>
3439
- <fo:inline id="{@id}">
3440
- <!-- for first p in annotation, put <x> -->
3441
- <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3878
+ </xsl:template><xsl:template match="*[local-name() = 'review']">
3879
+ <!-- comment 2019-11-29 -->
3880
+ <!-- <fo:block font-weight="bold">Review:</fo:block>
3881
+ <xsl:apply-templates /> -->
3882
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3883
+ <!-- 0xA0 to space replacement -->
3884
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3885
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3886
+ <fo:block-container margin-left="0mm">
3887
+ <xsl:if test="parent::*[local-name() = 'note']">
3888
+ <xsl:attribute name="margin-left">
3889
+ <xsl:choose>
3890
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3891
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3892
+ </xsl:choose>
3893
+ </xsl:attribute>
3894
+
3895
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3896
+
3897
+ </xsl:if>
3898
+ <fo:block-container margin-left="0mm">
3899
+ <xsl:apply-templates select="." mode="ul_ol"/>
3900
+ </fo:block-container>
3901
+ </fo:block-container>
3902
+ </xsl:template><xsl:template match="*[local-name() = 'errata']">
3903
+ <!-- <row>
3904
+ <date>05-07-2013</date>
3905
+ <type>Editorial</type>
3906
+ <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
3907
+ <pages>D-3</pages>
3908
+ </row>
3909
+ -->
3910
+ <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
3911
+ <fo:table-column column-width="20mm"/>
3912
+ <fo:table-column column-width="23mm"/>
3913
+ <fo:table-column column-width="107mm"/>
3914
+ <fo:table-column column-width="15mm"/>
3915
+ <fo:table-body>
3916
+ <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3917
+ <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3918
+ <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3919
+ <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
3920
+ <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
3921
+ </fo:table-row>
3922
+ <xsl:apply-templates/>
3923
+ </fo:table-body>
3924
+ </fo:table>
3925
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
3926
+ <fo:table-row>
3442
3927
  <xsl:apply-templates/>
3443
- </fo:inline>
3444
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3445
- <xsl:variable name="title-modified">
3446
- <xsl:call-template name="getTitle">
3447
- <xsl:with-param name="name" select="'title-modified'"/>
3448
- </xsl:call-template>
3449
- </xsl:variable>
3928
+ </fo:table-row>
3929
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
3930
+ <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3931
+ <fo:block><xsl:apply-templates/></fo:block>
3932
+ </fo:table-cell>
3933
+ </xsl:template><xsl:template name="processBibitem">
3934
+
3935
+
3936
+
3937
+
3938
+ </xsl:template><xsl:template name="processBibitemDocId">
3939
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
3450
3940
  <xsl:choose>
3451
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3452
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> </xsl:text></xsl:otherwise>
3941
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3942
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
3943
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3944
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3945
+ </xsl:if>
3946
+ <xsl:value-of select="$_doc_ident"/>
3947
+ </xsl:when>
3948
+ <xsl:otherwise>
3949
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3950
+ <xsl:if test="$type != ''">
3951
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3952
+ </xsl:if>
3953
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3954
+ </xsl:otherwise>
3453
3955
  </xsl:choose>
3454
- <xsl:apply-templates/>
3956
+ </xsl:template><xsl:template name="processPersonalAuthor">
3957
+ <xsl:choose>
3958
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3959
+ <author>
3960
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3961
+ </author>
3962
+ </xsl:when>
3963
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3964
+ <author>
3965
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3966
+ <xsl:text> </xsl:text>
3967
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3968
+ </author>
3969
+ </xsl:when>
3970
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3971
+ <author>
3972
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3973
+ <xsl:text> </xsl:text>
3974
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3975
+ </author>
3976
+ </xsl:when>
3977
+ <xsl:otherwise>
3978
+ <xsl:apply-templates/>
3979
+ </xsl:otherwise>
3980
+ </xsl:choose>
3981
+ </xsl:template><xsl:template name="renderDate">
3982
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3983
+ <xsl:value-of select="*[local-name() = 'on']"/>
3984
+ </xsl:if>
3985
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3986
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3987
+ </xsl:if>
3988
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
3989
+ <xsl:value-of select="translate(.,'. ','')"/>
3990
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3991
+ <xsl:value-of select="substring(.,1,1)"/>
3455
3992
  </xsl:template><xsl:template name="convertDate">
3456
3993
  <xsl:param name="date"/>
3457
3994
  <xsl:param name="format" select="'short'"/>
@@ -3584,27 +4121,49 @@
3584
4121
  </xsl:otherwise>
3585
4122
  </xsl:choose>
3586
4123
  </xsl:template><xsl:template name="getLevel">
3587
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
3588
- <xsl:variable name="level">
3589
- <xsl:choose>
3590
- <xsl:when test="ancestor::*[local-name() = 'preface']">
3591
- <xsl:value-of select="$level_total - 2"/>
3592
- </xsl:when>
3593
- <xsl:when test="ancestor::*[local-name() = 'sections']">
3594
- <xsl:value-of select="$level_total - 2"/>
3595
- </xsl:when>
3596
- <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3597
- <xsl:value-of select="$level_total - 2"/>
3598
- </xsl:when>
3599
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3600
- <xsl:otherwise>
3601
- <xsl:value-of select="$level_total - 1"/>
3602
- </xsl:otherwise>
3603
- </xsl:choose>
3604
- </xsl:variable>
3605
- <xsl:value-of select="$level"/>
3606
- </xsl:template><xsl:template name="getSubSection">
3607
- <xsl:number format=".1" level="multiple" count="*[local-name() = 'clause']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'terms'] | *[local-name() = 'terms']/*[local-name() = 'term'] | *[local-name() = 'clause']/*[local-name() = 'term'] | *[local-name() = 'terms']/*[local-name() = 'clause'] | *[local-name() = 'terms']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'definitions'] | *[local-name() = 'clause']/*[local-name() = 'references']"/>
4124
+ <xsl:param name="depth"/>
4125
+ <xsl:choose>
4126
+ <xsl:when test="normalize-space(@depth) != ''">
4127
+ <xsl:value-of select="@depth"/>
4128
+ </xsl:when>
4129
+ <xsl:when test="normalize-space($depth) != ''">
4130
+ <xsl:value-of select="$depth"/>
4131
+ </xsl:when>
4132
+ <xsl:otherwise>
4133
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
4134
+ <xsl:variable name="level">
4135
+ <xsl:choose>
4136
+ <xsl:when test="parent::*[local-name() = 'preface']">
4137
+ <xsl:value-of select="$level_total - 1"/>
4138
+ </xsl:when>
4139
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
4140
+ <xsl:value-of select="$level_total - 2"/>
4141
+ </xsl:when>
4142
+ <!-- <xsl:when test="parent::*[local-name() = 'sections']">
4143
+ <xsl:value-of select="$level_total - 1"/>
4144
+ </xsl:when> -->
4145
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
4146
+ <xsl:value-of select="$level_total - 1"/>
4147
+ </xsl:when>
4148
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
4149
+ <xsl:value-of select="$level_total - 1"/>
4150
+ </xsl:when>
4151
+ <xsl:when test="parent::*[local-name() = 'annex']">
4152
+ <xsl:value-of select="$level_total - 1"/>
4153
+ </xsl:when>
4154
+ <xsl:when test="ancestor::*[local-name() = 'annex']">
4155
+ <xsl:value-of select="$level_total"/>
4156
+ </xsl:when>
4157
+ <xsl:when test="local-name() = 'annex'">1</xsl:when>
4158
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
4159
+ <xsl:otherwise>
4160
+ <xsl:value-of select="$level_total - 1"/>
4161
+ </xsl:otherwise>
4162
+ </xsl:choose>
4163
+ </xsl:variable>
4164
+ <xsl:value-of select="$level"/>
4165
+ </xsl:otherwise>
4166
+ </xsl:choose>
3608
4167
  </xsl:template><xsl:template name="split">
3609
4168
  <xsl:param name="pText" select="."/>
3610
4169
  <xsl:param name="sep" select="','"/>
@@ -3635,7 +4194,8 @@
3635
4194
 
3636
4195
 
3637
4196
  <xsl:value-of select="document('')//*/namespace::gb"/>
3638
-
4197
+
4198
+
3639
4199
  </xsl:variable>
3640
4200
  <xsl:if test="$documentNS != $XSLNS">
3641
4201
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3650,4 +4210,15 @@
3650
4210
  <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3651
4211
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3652
4212
  </xsl:choose>
4213
+ </xsl:template><xsl:template name="setId">
4214
+ <xsl:attribute name="id">
4215
+ <xsl:choose>
4216
+ <xsl:when test="@id">
4217
+ <xsl:value-of select="@id"/>
4218
+ </xsl:when>
4219
+ <xsl:otherwise>
4220
+ <xsl:value-of select="generate-id()"/>
4221
+ </xsl:otherwise>
4222
+ </xsl:choose>
4223
+ </xsl:attribute>
3653
4224
  </xsl:template></xsl:stylesheet>