metanorma-ogc 1.2.1 → 1.2.2

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: 294cc548cfcdb632298e8cc49a7fe9b83e1961016f6d65e0fca475ff061fcb1b
4
- data.tar.gz: dd506401c8631fc0a703c928572c6e8959dd6ba8471667924a02f1f3996571e7
3
+ metadata.gz: c2015d66f65b872e8bd41ffbc65c7a9ebb50228937f7efb5ee32a5e254f41ff2
4
+ data.tar.gz: ca391594fc897a87f4c20c64776660737d6f702eb2a7a58d1125fbb49a7078be
5
5
  SHA512:
6
- metadata.gz: 608c44343f8690d6fba5be75d538f9fe4844cc441111de17e2674ecc8573095058ca8d471a2b9d77b17b5edd79294481f9c2e7b0d88ef845b0b50a79251c7730
7
- data.tar.gz: c72fd20a20757bec35cd19f64561b01a87e9a28a30a157396f8768d671be2ac1dfd159054f5fbe78d58e04abe47910d432591c7d9e0af2a79aae7abb0a04d6d1
6
+ metadata.gz: f8b982136f75e99af1b8f834714aa420f050ba75b85a473cc1175b8f393abcffbd1fc23991e3d13f5888875b1e81e75c2b7bc630e979591eb042562d3540d0c3
7
+ data.tar.gz: 447069d2e3be876e342c3730de38e1e564e42b672e701cdbadbafc331a1cc0bc2ac76fea1c89402f118afcd86eb8e81d7bb0a1657b88822fe515c0f32969ceb8
@@ -25,7 +25,7 @@ module Asciidoctor
25
25
  end
26
26
 
27
27
  def doctype(node)
28
- d = node.attr("doctype")
28
+ d = super
29
29
  d1 = ::IsoDoc::Ogc::DOCTYPE_ABBR.invert[d] and d = d1
30
30
  unless %w{abstract-specification-topic best-practice
31
31
  change-request-supporting-document community-practice
@@ -104,7 +104,7 @@ module Asciidoctor
104
104
  end
105
105
 
106
106
  def externalurl(node)
107
- if node.attr("doctype") == "engineering-report"
107
+ if doctype(node) == "engineering-report"
108
108
  "http://www.opengis.net/doc/PER/t14-#{node.attr('referenceurlid')}"
109
109
  else
110
110
  node.attr('referenceurlid')
@@ -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">
@@ -1,5 +1,4 @@
1
1
  require "isodoc"
2
- require_relative "reqt"
3
2
  require_relative "biblio"
4
3
  require_relative "sections"
5
4
  require "fileutils"
@@ -8,31 +7,11 @@ module IsoDoc
8
7
  module Ogc
9
8
  module BaseConvert
10
9
  def cleanup(docxml)
11
- requirement_table_cleanup(docxml)
10
+ #requirement_table_cleanup(docxml)
12
11
  super
13
12
  term_cleanup(docxml)
14
13
  end
15
14
 
16
- # table nested in table: merge label and caption into a single row
17
- def requirement_table_cleanup(docxml)
18
- docxml.xpath("//table[@class = 'recommendclass']//table").each do |t|
19
- x = t.at("./thead") and x.replace(x.children)
20
- x = t.at("./tbody") and x.replace(x.children)
21
- x = t.at("./tfoot") and x.replace(x.children)
22
- if x = t.at("./tr/th[@colspan = '2']") and
23
- y = t.at("./tr/td[@colspan = '2']")
24
- x["colspan"] = "1"
25
- y["colspan"] = "1"
26
- x.name = "td"
27
- p = x.at("./p[@class = 'RecommendationTitle']") and
28
- p.delete("class")
29
- x << y.dup
30
- y.parent.remove
31
- end
32
- t.replace(t.children)
33
- end
34
- end
35
-
36
15
  def term_cleanup(docxml)
37
16
  docxml.xpath("//p[@class = 'Terms']").each do |d|
38
17
  h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
@@ -62,6 +41,11 @@ module IsoDoc
62
41
  "@type = 'conformance')][not(descendant::terms)]"
63
42
  end
64
43
 
44
+ def is_clause?(name)
45
+ return true if name == "submitters"
46
+ super
47
+ end
48
+
65
49
  def middle(isoxml, out)
66
50
  middle_title(out)
67
51
  middle_admonitions(isoxml, out)
@@ -74,6 +58,31 @@ module IsoDoc
74
58
  annex isoxml, out
75
59
  bibliography isoxml, out
76
60
  end
61
+
62
+ def table_attrs(node)
63
+ ret = super
64
+ %w(recommendation requirement permission).include?(node["class"]) and
65
+ ret = ret.merge(class: node["type"], style:
66
+ "border-collapse:collapse;border-spacing:0;"\
67
+ "#{keep_style(node)}")
68
+ ret
69
+ end
70
+
71
+ def make_tr_attr(td, row, totalrows, header)
72
+ ret = super
73
+ if td.at("./ancestor::xmlns:table[@class = 'recommendation'] | "\
74
+ "./ancestor::xmlns:table[@class = 'requirement'] | "\
75
+ "./ancestor::xmlns:table[@class = 'permission']")
76
+ ret[:style] = "vertical-align:top;"
77
+ ret[:class] = "recommend"
78
+ end
79
+ ret
80
+ end
81
+
82
+ def para_class(node)
83
+ return node["class"] if node["class"]
84
+ super
85
+ end
77
86
  end
78
87
  end
79
88
  end
@@ -63,6 +63,7 @@ module IsoDoc
63
63
  body.div **{ class: "main-section" } do |div3|
64
64
  @prefacenum = 0
65
65
  boilerplate docxml, div3
66
+ preface_block docxml, div3
66
67
  abstract docxml, div3
67
68
  keywords docxml, div3
68
69
  foreword docxml, div3
@@ -802,43 +802,8 @@
802
802
  <fo:block id="{@id}" margin-bottom="12pt" start-indent="12mm" text-indent="-12mm" line-height="115%">
803
803
  <xsl:if test=".//ogc:fn">
804
804
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
805
- </xsl:if>
806
- <xsl:choose>
807
- <xsl:when test="ogc:formattedref">
808
- <xsl:apply-templates select="ogc:formattedref"/>
809
- </xsl:when>
810
- <xsl:otherwise>
811
- <xsl:for-each select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
812
- <xsl:apply-templates/>
813
- <xsl:if test="position() != last()">, </xsl:if>
814
- <xsl:if test="position() = last()">: </xsl:if>
815
- </xsl:for-each>
816
- <!-- ogc:docidentifier -->
817
- <xsl:if test="ogc:docidentifier">
818
- <xsl:value-of select="ogc:docidentifier/@type"/><xsl:text> </xsl:text>
819
- <xsl:value-of select="ogc:docidentifier"/>
820
- </xsl:if>
821
- <xsl:apply-templates select="ogc:note"/>
822
- <xsl:if test="ogc:docidentifier">, </xsl:if>
823
- <fo:inline font-style="italic">
824
- <xsl:choose>
825
- <xsl:when test="ogc:title[@type = 'main' and @language = 'en']">
826
- <xsl:value-of select="ogc:title[@type = 'main' and @language = 'en']"/><xsl:text>. </xsl:text>
827
- </xsl:when>
828
- <xsl:otherwise>
829
- <xsl:value-of select="ogc:title"/><xsl:text>. </xsl:text>
830
- </xsl:otherwise>
831
- </xsl:choose>
832
- </fo:inline>
833
- <xsl:for-each select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
834
- <xsl:apply-templates/>
835
- <xsl:if test="position() != last()">, </xsl:if>
836
- </xsl:for-each>
837
- <xsl:if test="ogc:date[@type='published']/ogc:on">
838
- <xsl:text>(</xsl:text><xsl:value-of select="ogc:date[@type='published']/ogc:on"/><xsl:text>)</xsl:text>
839
- </xsl:if>
840
- </xsl:otherwise>
841
- </xsl:choose>
805
+ </xsl:if>
806
+ <xsl:call-template name="processBibitem"/>
842
807
  </fo:block>
843
808
  </xsl:template>
844
809
 
@@ -971,8 +936,7 @@
971
936
  </fo:block>
972
937
  </xsl:template>
973
938
 
974
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
975
- <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem"> [position() &gt; 1] -->
939
+ <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
976
940
  <xsl:template match="ogc:references[not(@normative='true')]/ogc:bibitem">
977
941
  <fo:list-block id="{@id}" margin-bottom="12pt" provisional-distance-between-starts="12mm">
978
942
  <fo:list-item>
@@ -985,80 +949,23 @@
985
949
  </fo:list-item-label>
986
950
  <fo:list-item-body start-indent="body-start()">
987
951
  <fo:block>
988
-
989
- <xsl:if test="not(ogc:formattedref)">
990
- <xsl:choose>
991
- <xsl:when test="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:abbreviation">
992
- <xsl:for-each select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:abbreviation">
993
- <xsl:value-of select="."/>
994
- <xsl:if test="position() != last()">/</xsl:if>
995
- </xsl:for-each>
996
- <xsl:text>: </xsl:text>
997
- </xsl:when>
998
- <xsl:when test="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
999
- <xsl:value-of select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name"/>
1000
- <xsl:text>: </xsl:text>
1001
- </xsl:when>
1002
- </xsl:choose>
1003
-
1004
- </xsl:if>
1005
-
1006
- <xsl:if test="ogc:docidentifier">
1007
- <xsl:choose>
1008
- <xsl:when test="ogc:docidentifier/@type = 'ISO' and ogc:formattedref"/>
1009
- <xsl:when test="ogc:docidentifier/@type = 'OGC' and ogc:formattedref"/>
1010
- <xsl:otherwise><fo:inline>
1011
- <xsl:if test="ogc:docidentifier/@type = 'OGC'">OGC </xsl:if>
1012
- <xsl:value-of select="ogc:docidentifier"/><xsl:apply-templates select="ogc:note"/>, </fo:inline></xsl:otherwise>
1013
- </xsl:choose>
1014
- </xsl:if>
1015
-
1016
-
1017
-
1018
- <xsl:choose>
1019
- <xsl:when test="ogc:title[@type = 'main' and @language = 'en']">
1020
- <xsl:apply-templates select="ogc:title[@type = 'main' and @language = 'en']"/>
1021
- </xsl:when>
1022
- <xsl:otherwise>
1023
- <xsl:apply-templates select="ogc:title"/>
1024
- </xsl:otherwise>
1025
- </xsl:choose>
1026
- <xsl:if test="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
1027
- <xsl:text>, </xsl:text>
1028
- <xsl:for-each select="ogc:contributor[ogc:role/@type='publisher']/ogc:organization/ogc:name">
1029
- <xsl:if test="position() != last()">and </xsl:if>
1030
- <xsl:value-of select="."/>
1031
- </xsl:for-each>
1032
-
1033
- </xsl:if>
1034
- <xsl:if test="ogc:place">
1035
- <xsl:text>, </xsl:text>
1036
- <xsl:value-of select="ogc:place"/>
1037
- </xsl:if>
1038
- <xsl:if test="ogc:date[@type='published']/ogc:on">
1039
- <xsl:text> (</xsl:text><xsl:value-of select="ogc:date[@type='published']/ogc:on"/><xsl:text>).</xsl:text>
1040
- </xsl:if>
1041
- <xsl:apply-templates select="ogc:formattedref"/>
952
+ <xsl:call-template name="processBibitem"/>
1042
953
  </fo:block>
1043
954
  </fo:list-item-body>
1044
955
  </fo:list-item>
1045
956
  </fo:list-block>
1046
957
  </xsl:template>
1047
958
 
1048
- <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem" mode="contents"/> [position() &gt; 1] -->
959
+
1049
960
  <xsl:template match="ogc:references[not(@normative='true')]/ogc:bibitem" mode="contents"/>
1050
961
 
1051
- <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem/ogc:title"> [position() &gt; 1]-->
1052
- <xsl:template match="ogc:references[not(@normative='true')]/ogc:bibitem/ogc:title">
962
+ <xsl:template match="ogc:bibitem/ogc:title">
1053
963
  <fo:inline font-style="italic">
1054
964
  <xsl:apply-templates/>
1055
965
  </fo:inline>
1056
966
  </xsl:template>
1057
967
 
1058
968
 
1059
-
1060
-
1061
-
1062
969
  <xsl:template match="ogc:admonition">
1063
970
  <fo:block-container border="0.5pt solid rgb(79, 129, 189)" color="rgb(79, 129, 189)" margin-left="16mm" margin-right="16mm" margin-bottom="12pt">
1064
971
  <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm">
@@ -2541,14 +2448,36 @@
2541
2448
  <fo:table-cell>
2542
2449
  <fo:block>
2543
2450
 
2544
-
2451
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2452
+ <xsl:if test="local-name(*[1]) != 'stem'">
2453
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2454
+ </xsl:if>
2455
+ </xsl:if> -->
2545
2456
 
2546
2457
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2547
2458
 
2548
2459
  </fo:block>
2549
2460
  </fo:table-cell>
2550
2461
  </fo:table-row>
2551
-
2462
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2463
+ <xsl:if test="local-name(*[1]) = 'stem'">
2464
+ <fo:table-row>
2465
+ <fo:table-cell>
2466
+ <fo:block margin-top="6pt">
2467
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2468
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2469
+ </xsl:if>
2470
+ <xsl:text>&#xA0;</xsl:text>
2471
+ </fo:block>
2472
+ </fo:table-cell>
2473
+ <fo:table-cell>
2474
+ <fo:block>
2475
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2476
+ </fo:block>
2477
+ </fo:table-cell>
2478
+ </fo:table-row>
2479
+ </xsl:if>
2480
+ </xsl:if> -->
2552
2481
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2553
2482
  <xsl:apply-templates/>
2554
2483
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -3310,22 +3239,30 @@
3310
3239
  </fo:block>
3311
3240
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3312
3241
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3242
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3243
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3244
+ </xsl:if>
3313
3245
  <fo:block-container margin-left="0mm" margin-right="0mm">
3314
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
3246
+ <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
3247
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3248
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3249
+ </xsl:if>
3315
3250
  <xsl:variable name="simple-table">
3316
3251
  <xsl:call-template name="getSimpleTable"/>
3317
3252
  </xsl:variable>
3318
3253
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3319
3254
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3320
- <fo:table-column column-width="35mm"/>
3321
- <fo:table-column column-width="115mm"/>
3255
+ <!-- <fo:table-column column-width="35mm"/>
3256
+ <fo:table-column column-width="115mm"/> -->
3257
+ <fo:table-column column-width="25%"/>
3258
+ <fo:table-column column-width="75%"/>
3322
3259
  </xsl:if>
3323
3260
  <xsl:apply-templates mode="requirement"/>
3324
3261
  </fo:table>
3325
3262
  <!-- fn processing -->
3326
3263
  <xsl:if test=".//*[local-name() = 'fn']">
3327
3264
  <xsl:for-each select="*[local-name() = 'tbody']">
3328
- <fo:block font-size="90%" border-bottom="1.pt solid black">
3265
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3329
3266
  <xsl:call-template name="fn_display"/>
3330
3267
  </fo:block>
3331
3268
  </xsl:for-each>
@@ -3341,17 +3278,20 @@
3341
3278
  <xsl:apply-templates mode="requirement"/>
3342
3279
  </fo:table-body>
3343
3280
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3344
- <fo:table-row>
3281
+ <fo:table-row height="7mm">
3282
+ <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
3283
+ <xsl:attribute name="border">1pt solid black</xsl:attribute>
3284
+ </xsl:if>
3345
3285
  <xsl:apply-templates mode="requirement"/>
3346
3286
  </fo:table-row>
3347
3287
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3348
- <fo:table-cell text-align="{@align}">
3288
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3349
3289
  <xsl:attribute name="text-align">
3350
3290
  <xsl:choose>
3351
3291
  <xsl:when test="@align">
3352
3292
  <xsl:value-of select="@align"/>
3353
3293
  </xsl:when>
3354
- <xsl:otherwise>center</xsl:otherwise>
3294
+ <xsl:otherwise>left</xsl:otherwise>
3355
3295
  </xsl:choose>
3356
3296
  </xsl:attribute>
3357
3297
  <xsl:if test="@colspan">
@@ -3365,21 +3305,25 @@
3365
3305
  </xsl:attribute>
3366
3306
  </xsl:if>
3367
3307
 
3368
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3308
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3369
3309
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3370
3310
  <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3371
3311
  </xsl:if>
3372
3312
  <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3373
3313
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3374
3314
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3375
- </xsl:if>
3315
+ </xsl:if> -->
3376
3316
 
3377
3317
  <fo:block>
3378
3318
  <xsl:apply-templates/>
3379
3319
  </fo:block>
3380
3320
  </fo:table-cell>
3381
3321
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3382
- <fo:table-cell text-align="{@align}">
3322
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3323
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3324
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3325
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3326
+ </xsl:if>
3383
3327
  <xsl:attribute name="text-align">
3384
3328
  <xsl:choose>
3385
3329
  <xsl:when test="@align">
@@ -3399,24 +3343,25 @@
3399
3343
  </xsl:attribute>
3400
3344
  </xsl:if>
3401
3345
 
3402
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3346
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3403
3347
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3404
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3405
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
3348
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3349
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3406
3350
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3407
3351
  </xsl:if>
3408
- </xsl:if>
3352
+ </xsl:if> -->
3353
+ <!-- 2nd line and below -->
3409
3354
 
3410
3355
  <fo:block>
3411
3356
  <xsl:apply-templates/>
3412
3357
  </fo:block>
3413
3358
  </fo:table-cell>
3414
3359
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3415
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
3360
+ <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
3416
3361
  <xsl:apply-templates/>
3417
3362
  </fo:block>
3418
- </xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3419
- <fo:block margin-bottom="10pt">
3363
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3364
+ <fo:block> <!-- margin-bottom="10pt" -->
3420
3365
  <xsl:apply-templates/>
3421
3366
  </fo:block>
3422
3367
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
@@ -3757,6 +3702,195 @@
3757
3702
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3758
3703
  <fo:block><xsl:apply-templates/></fo:block>
3759
3704
  </fo:table-cell>
3705
+ </xsl:template><xsl:template name="processBibitem">
3706
+
3707
+ <xsl:choose>
3708
+ <xsl:when test="*[local-name() = 'formattedref']">
3709
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
3710
+ </xsl:when>
3711
+ <xsl:otherwise>
3712
+ <xsl:variable name="personalAuthors">
3713
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person']">
3714
+ <xsl:call-template name="processPersonalAuthor"/>
3715
+ </xsl:for-each>
3716
+ <xsl:if test="not(*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'person'])">
3717
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']/*[local-name() = 'person']">
3718
+ <xsl:call-template name="processPersonalAuthor"/>
3719
+ </xsl:for-each>
3720
+ </xsl:if>
3721
+ </xsl:variable>
3722
+
3723
+ <xsl:variable name="city" select="*[local-name() = 'place']"/>
3724
+ <xsl:variable name="year">
3725
+ <xsl:choose>
3726
+ <xsl:when test="*[local-name() = 'date'][@type = 'published']">
3727
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'published']">
3728
+ <xsl:call-template name="renderDate"/>
3729
+ </xsl:for-each>
3730
+ </xsl:when>
3731
+ <xsl:when test="*[local-name() = 'date'][@type = 'issued']">
3732
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'issued']">
3733
+ <xsl:call-template name="renderDate"/>
3734
+ </xsl:for-each>
3735
+ </xsl:when>
3736
+ <xsl:when test="*[local-name() = 'date'][@type = 'circulated']">
3737
+ <xsl:for-each select="*[local-name() = 'date'][@type = 'circulated']">
3738
+ <xsl:call-template name="renderDate"/>
3739
+ </xsl:for-each>
3740
+ </xsl:when>
3741
+ <xsl:otherwise>
3742
+ <xsl:for-each select="*[local-name() = 'date']">
3743
+ <xsl:call-template name="renderDate"/>
3744
+ </xsl:for-each>
3745
+ </xsl:otherwise>
3746
+ </xsl:choose>
3747
+ </xsl:variable>
3748
+
3749
+ <xsl:variable name="uri" select="*[local-name() = 'uri']"/>
3750
+
3751
+
3752
+ <!-- citation structure:
3753
+ {personal names | organisation}: {document identifier}, {title}. {publisher}, {city} ({year})
3754
+ -->
3755
+
3756
+ <!-- Author(s) -->
3757
+ <xsl:choose>
3758
+ <xsl:when test="xalan:nodeset($personalAuthors)//author">
3759
+ <xsl:for-each select="xalan:nodeset($personalAuthors)//author">
3760
+ <xsl:apply-templates/>
3761
+ <xsl:if test="position() != last()">, </xsl:if>
3762
+ </xsl:for-each>
3763
+ <xsl:text>: </xsl:text>
3764
+ </xsl:when>
3765
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
3766
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'abbreviation']">
3767
+ <xsl:value-of select="."/>
3768
+ <xsl:if test="position() != last()">/</xsl:if>
3769
+ </xsl:for-each>
3770
+ <xsl:text>: </xsl:text>
3771
+ </xsl:when>
3772
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
3773
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
3774
+ <xsl:value-of select="."/>
3775
+ <xsl:if test="position() != last()">, </xsl:if>
3776
+ </xsl:for-each>
3777
+ <xsl:text>: </xsl:text>
3778
+ </xsl:when>
3779
+ </xsl:choose>
3780
+
3781
+
3782
+ <xsl:variable name="document_identifier">
3783
+ <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')]"/>
3784
+ <xsl:choose>
3785
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3786
+ <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"/>
3787
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3788
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3789
+ </xsl:if>
3790
+ <xsl:value-of select="$_doc_ident"/>
3791
+ </xsl:when>
3792
+ <xsl:otherwise>
3793
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3794
+ <xsl:if test="$type != ''">
3795
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3796
+ </xsl:if>
3797
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3798
+ </xsl:otherwise>
3799
+ </xsl:choose>
3800
+ </xsl:variable>
3801
+
3802
+ <xsl:value-of select="$document_identifier"/>
3803
+
3804
+ <xsl:apply-templates select="*[local-name() = 'note']"/>
3805
+
3806
+ <xsl:variable name="isDraft">
3807
+ <xsl:variable name="stage" select="normalize-space(*[local-name() = 'status']/*[local-name() = 'stage'])"/>
3808
+ <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization'][*[local-name() = 'name']/text() = 'Open Geospatial Consortium'] and $stage != '' and $stage != 'published' and $stage != 'deprecated' and $stage != 'retired'">true</xsl:if>
3809
+ </xsl:variable>
3810
+
3811
+ <xsl:if test="$isDraft = 'true'">
3812
+ <xsl:text> (Draft)</xsl:text>
3813
+ </xsl:if>
3814
+
3815
+ <xsl:text>, </xsl:text>
3816
+
3817
+ <xsl:choose>
3818
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
3819
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
3820
+ </xsl:when>
3821
+ <xsl:otherwise>
3822
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
3823
+ </xsl:otherwise>
3824
+ </xsl:choose>
3825
+
3826
+ <xsl:text>. </xsl:text>
3827
+
3828
+ <xsl:if test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
3829
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name']">
3830
+ <xsl:value-of select="."/>
3831
+ <xsl:if test="position() != last()">, </xsl:if>
3832
+ </xsl:for-each>
3833
+ <xsl:if test="normalize-space($city) != ''">, </xsl:if>
3834
+ </xsl:if>
3835
+
3836
+ <xsl:value-of select="$city"/>
3837
+
3838
+ <xsl:if test="(*[local-name() = 'contributor'][*[local-name() = 'role']/@type = 'publisher']/*[local-name() = 'organization']/*[local-name() = 'name'] or normalize-space($city) != '') and normalize-space($year) != ''">
3839
+ <xsl:text> </xsl:text>
3840
+ </xsl:if>
3841
+
3842
+ <xsl:if test="normalize-space($year) != ''">
3843
+ <xsl:text>(</xsl:text>
3844
+ <xsl:value-of select="$year"/>
3845
+ <xsl:text>). </xsl:text>
3846
+ </xsl:if>
3847
+
3848
+ <xsl:if test="normalize-space($uri) != ''">
3849
+ <xsl:text> </xsl:text>
3850
+ <fo:basic-link external-destination="{$uri}" fox:alt-text="{$uri}">
3851
+ <xsl:value-of select="$uri"/>
3852
+ </fo:basic-link>
3853
+ </xsl:if>
3854
+
3855
+ </xsl:otherwise>
3856
+ </xsl:choose>
3857
+
3858
+ </xsl:template><xsl:template name="processPersonalAuthor">
3859
+ <xsl:choose>
3860
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3861
+ <author>
3862
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3863
+ </author>
3864
+ </xsl:when>
3865
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3866
+ <author>
3867
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3868
+ <xsl:text> </xsl:text>
3869
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3870
+ </author>
3871
+ </xsl:when>
3872
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3873
+ <author>
3874
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3875
+ <xsl:text> </xsl:text>
3876
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3877
+ </author>
3878
+ </xsl:when>
3879
+ <xsl:otherwise>
3880
+ <xsl:apply-templates/>
3881
+ </xsl:otherwise>
3882
+ </xsl:choose>
3883
+ </xsl:template><xsl:template name="renderDate">
3884
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3885
+ <xsl:value-of select="*[local-name() = 'on']"/>
3886
+ </xsl:if>
3887
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3888
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3889
+ </xsl:if>
3890
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
3891
+ <xsl:value-of select="translate(.,'. ','')"/>
3892
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3893
+ <xsl:value-of select="substring(.,1,1)"/>
3760
3894
  </xsl:template><xsl:template name="convertDate">
3761
3895
  <xsl:param name="date"/>
3762
3896
  <xsl:param name="format" select="'short'"/>