-
Notifications
You must be signed in to change notification settings - Fork 3
/
jats-html.xsl
4026 lines (3276 loc) · 134 KB
/
jats-html.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<!-- ============================================================= -->
<!-- MODULE: HTML Preview of NISO JATS Publishing 1.0 XML -->
<!-- DATE: May-June 2012 -->
<!-- -->
<!-- ============================================================= -->
<!-- ============================================================= -->
<!-- SYSTEM: NCBI Archiving and Interchange Journal Articles -->
<!-- -->
<!-- PURPOSE: Provide an HTML preview of a journal article, -->
<!-- in a form suitable for reading. -->
<!-- -->
<!-- PROCESSOR DEPENDENCIES: -->
<!-- None: standard XSLT 1.0 -->
<!-- Tested using Saxon 6.5, Tranformiix (Firefox), -->
<!-- Saxon 9.4.0.3 -->
<!-- -->
<!-- COMPONENTS REQUIRED: -->
<!-- 1) This stylesheet -->
<!-- 2) CSS styles defined in jats-preview.css -->
<!-- (to be placed with the results) -->
<!-- -->
<!-- INPUT: An XML document valid to (any of) the -->
<!-- NISO JATS 1.0, NLM/NCBI Journal Publishing 3.0, -->
<!-- or NLM/NCBI Journal Publishing 2.3 DTDs. -->
<!-- (May also work with older variants, -->
<!-- and note further assumptions and limitations -->
<!-- below.) -->
<!-- -->
<!-- OUTPUT: HTML (XHTML if a postprocessor is used) -->
<!-- -->
<!-- CREATED FOR: -->
<!-- Digital Archive of Journal Articles -->
<!-- National Center for Biotechnology Information (NCBI) -->
<!-- National Library of Medicine (NLM) -->
<!-- -->
<!-- CREATED BY: -->
<!-- Wendell Piez (based on HTML design by -->
<!-- Kate Hamilton and Debbie Lapeyre, 2004), -->
<!-- Mulberry Technologies, Inc. -->
<!-- -->
<!-- ============================================================= -->
<!-- ============================================================= -->
<!--
This work is in the public domain and may be reproduced, published or
otherwise used without the permission of the National Library of Medicine (NLM).
We request only that the NLM is cited as the source of the work.
Although all reasonable efforts have been taken to ensure the accuracy and
reliability of the software and data, the NLM and the U.S. Government do
not and cannot warrant the performance or results that may be obtained by
using this software or data. The NLM and the U.S. Government disclaim all
warranties, express or implied, including warranties of performance,
merchantability or fitness for any particular purpose.
-->
<!-- ============================================================= -->
<!-- Change history -->
<!-- From jpub3-html.xsl v3.0 to jats-html.xsl v1.0:
Calls to 'normalize-space($node)' where $node is not a string are
expressed as 'normalize-space(string($node)) in order to provide
type safety in some XSLT 2.0 processors.
Support for certain elements in NLM Blue v2.3 is added to provide
backward compatibility:
floats-wrap (same as floats-group)
chem-struct-wrapper (same as chem-struct-wrap)
custom-meta-wrap (same as custom-meta-group)
floats-wrap (same as floats-group)
gloss-group (same as glossary)
citation
contract-num
contract-sponsor
grant-num
grant-sponsor
Support is added for looser structures for title-group elements
in 2.3 (title, trans-title, trans-subtitle etc.) Same for 2.3
tagging of permissions info (copyright-statement, copyright-year,
license) and funding/contract info (contract-num, contract-sponsor,
grant-num, grant-sponsor).
Elements newly permitted in JATS journal-meta
(contrib-group, aff, aff-alternatives) are supported.
New elements in NISO JATS v1.0 are supported:
aff-alternatives
citation-alternatives
collab-alternatives
trans-title-group (with @xml:lang)
contrib-id
count>
issn-l
nested-kwd
Added support for @pub-id-type='arXiv'
Named anchor logic extended to support "alternatives" wrappers
for aff, contrib, citation etc.
Footer text is emended, with name of transformation (stylesheet
or pipeline) parameterized.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">
<!--<xsl:output method="xml" indent="no" encoding="UTF-8"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>-->
<xsl:output doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
encoding="UTF-8"/>
<xsl:strip-space elements="*"/>
<!-- Space is preserved in all elements allowing #PCDATA -->
<xsl:preserve-space
elements="abbrev abbrev-journal-title access-date addr-line
aff alt-text alt-title article-id article-title
attrib award-id bold chapter-title chem-struct
collab comment compound-kwd-part compound-subject-part
conf-acronym conf-date conf-loc conf-name conf-num
conf-sponsor conf-theme contrib-id copyright-holder
copyright-statement copyright-year corresp country
date-in-citation day def-head degrees disp-formula
edition elocation-id email etal ext-link fax fpage
funding-source funding-statement given-names glyph-data
gov inline-formula inline-supplementary-material
institution isbn issn-l issn issue issue-id issue-part
issue-sponsor issue-title italic journal-id
journal-subtitle journal-title kwd label license-p
long-desc lpage meta-name meta-value mixed-citation
monospace month named-content object-id on-behalf-of
overline p page-range part-title patent person-group
phone prefix preformat price principal-award-recipient
principal-investigator product pub-id publisher-loc
publisher-name related-article related-object role
roman sans-serif sc season self-uri series series-text
series-title sig sig-block size source speaker std
strike string-name styled-content std-organization
sub subject subtitle suffix sup supplement surname
target td term term-head tex-math textual-form th
time-stamp title trans-source trans-subtitle trans-title
underline uri verse-line volume volume-id volume-series
xref year
mml:annotation mml:ci mml:cn mml:csymbol mml:mi mml:mn
mml:mo mml:ms mml:mtext"/>
<xsl:param name="transform" select="'jats-html.xsl'"/>
<xsl:param name="css" select="'jats-preview.css'"/>
<xsl:param name="report-warnings" select="'no'"/>
<xsl:variable name="verbose" select="$report-warnings='yes'"/>
<!-- Keys -->
<!-- To reduce dependency on a DTD for processing, we declare
a key to use instead of the id() function. -->
<xsl:key name="element-by-id" match="*[@id]" use="string(@id)"/>
<!-- Enabling retrieval of cross-references to objects -->
<xsl:key name="xref-by-rid" match="xref" use="string(@rid)"/>
<!-- ============================================================= -->
<!-- ROOT TEMPLATE - HANDLES HTML FRAMEWORK -->
<!-- ============================================================= -->
<xsl:template match="/">
<!-- <html> -->
<!-- <!-\- HTML header -\-> -->
<!-- <xsl:call-template name="make-html-header"/> -->
<!-- <body> -->
<div>
<xsl:apply-templates/>
</div>
<!-- </body> -->
<!-- </html> -->
</xsl:template>
<xsl:template name="make-html-header">
<head>
<title>
<xsl:variable name="authors">
<xsl:call-template name="author-string"/>
</xsl:variable>
<xsl:value-of select="normalize-space(string($authors))"/>
<xsl:if test="normalize-space(string($authors))">: </xsl:if>
<xsl:value-of
select="/article/front/article-meta/title-group/article-title[1]"/>
</title>
<link rel="stylesheet" type="text/css" href="{$css}"/>
<!-- XXX check: any other header stuff? XXX -->
</head>
</xsl:template>
<!-- ============================================================= -->
<!-- TOP LEVEL -->
<!-- ============================================================= -->
<!--
content model for article:
(front,body?,back?,floats-group?,(sub-article*|response*))
content model for sub-article:
((front|front-stub),body?,back?,floats-group?,
(sub-article*|response*))
content model for response:
((front|front-stub),body?,back?,floats-group?) -->
<xsl:template match="article">
<xsl:call-template name="make-article"/>
</xsl:template>
<xsl:template match="sub-article | response">
<hr class="part-rule"/>
<xsl:call-template name="make-article"/>
</xsl:template>
<!-- ============================================================= -->
<!-- "make-article" for the document architecture -->
<!-- ============================================================= -->
<xsl:template name="make-article">
<!-- Generates a series of (flattened) divs for contents of any
article, sub-article or response -->
<!-- variable to be used in div id's to keep them unique -->
<xsl:variable name="this-article">
<xsl:apply-templates select="." mode="id"/>
</xsl:variable>
<div id="{$this-article}-front" class="front">
<xsl:apply-templates select="front | front-stub"/>
</div>
<!-- body -->
<xsl:for-each select="body">
<div id="{$this-article}-body" class="body">
<xsl:apply-templates/>
</div>
</xsl:for-each>
<xsl:if test="back | $loose-footnotes">
<!-- $loose-footnotes is defined below as any footnotes outside
front matter or fn-group -->
<div id="{$this-article}-back" class="back">
<xsl:call-template name="make-back"/>
</div>
</xsl:if>
<xsl:for-each select="floats-group | floats-wrap">
<!-- floats-wrap is from 2.3 -->
<div id="{$this-article}-floats" class="back">
<xsl:call-template name="main-title">
<xsl:with-param name="contents">
<span class="generated">Floating objects</span>
</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates/>
</div>
</xsl:for-each>
<!-- more metadata goes in the footer -->
<div id="{$this-article}-footer" class="footer">
<xsl:call-template name="footer-metadata"/>
<xsl:call-template name="footer-branding"/>
</div>
<!-- sub-article or response (recursively calls
this template) -->
<xsl:apply-templates select="sub-article | response"/>
</xsl:template>
<xsl:template match="front | front-stub">
<!-- First Table: journal and article metadata -->
<div class="metadata two-column table">
<div class="row">
<!-- Cell 1: journal information -->
<xsl:for-each select="journal-meta">
<!-- (journal-id+, journal-title-group*, (contrib-group | aff | aff-alternatives)*,
issn+, issn-l?, isbn*, publisher?, notes*, self-uri*) -->
<div class="cell">
<h4 class="generated">
<xsl:text>Journal Information</xsl:text>
</h4>
<div class="metadata-group">
<xsl:apply-templates select="journal-id | journal-title-group" mode="metadata"/>
<!-- the following may appear in 2.3 -->
<xsl:apply-templates mode="metadata" select="journal-title | journal-subtitle | trans-title | trans-subtitle | abbrev-journal-title"/>
<!-- contrib-group, aff, aff-alternatives, author-notes -->
<xsl:apply-templates mode="metadata"
select="contrib-group"/>
<xsl:if test="aff | aff-alternatives | author-notes">
<div class="metadata-group">
<xsl:apply-templates mode="metadata"
select="aff | aff-alternatives | author-notes"/>
</div>
</xsl:if>
<xsl:apply-templates select="issn | issn-l | isbn | publisher | notes | self-uri" mode="metadata"/>
</div>
</div>
</xsl:for-each>
<!-- Cell 2: Article information -->
<xsl:for-each select="article-meta | self::front-stub">
<!-- content model:
(article-id*, article-categories?, title-group,
(contrib-group | aff)*,
author-notes?, pub-date+, volume?, volume-id*,
volume-series?, issue?, issue-id*, issue-title*,
issue-sponsor*, issue-part?, isbn*, supplement?,
((fpage, lpage?, page-range?) | elocation-id)?,
(email | ext-link | uri | product |
supplementary-material)*,
history?, permissions?, self-uri*, related-article*,
abstract*, trans-abstract*,
kwd-group*, funding-group*, conference*, counts?,
custom-meta-group?)
These are handled as follows:
In the "Article Information" header cell:
article-id
pub-date
volume
volume-id
volume-series
issue
issue-id
issue-title
issue-sponsor
issue-part
isbn
supplement
fpage
lpage
page-range
elocation-id
email
ext-link
uri
product
history
permissions
self-uri
related-article
funding-group
conference
In the "Article title" cell:
title-group
contrib-group
aff
author-notes
abstract
trans-abstract
In the metadata footer
article-categories
supplementary-material
kwd-group
counts
custom-meta-group
-->
<div class="cell">
<h4 class="generated">
<xsl:text>Article Information</xsl:text>
</h4>
<div class="metadata-group">
<xsl:apply-templates mode="metadata"
select="email | ext-link | uri | self-uri"/>
<xsl:apply-templates mode="metadata" select="product"/>
<!-- only in 2.3 -->
<xsl:apply-templates mode="metadata" select="copyright-statement |
copyright-year | license"/>
<xsl:apply-templates mode="metadata" select="permissions"/>
<xsl:apply-templates mode="metadata" select="history/date"/>
<xsl:apply-templates mode="metadata" select="pub-date"/>
<xsl:call-template name="volume-info">
<!-- handles volume?, volume-id*, volume-series? -->
</xsl:call-template>
<xsl:call-template name="issue-info">
<!-- handles issue?, issue-id*, issue-title*,
issue-sponsor*, issue-part? -->
</xsl:call-template>
<xsl:call-template name="page-info">
<!-- handles (fpage, lpage?, page-range?) -->
</xsl:call-template>
<xsl:apply-templates mode="metadata" select="elocation-id"/>
<xsl:apply-templates mode="metadata" select="isbn"/>
<xsl:apply-templates mode="metadata"
select="supplement | related-article | conference"/>
<xsl:apply-templates mode="metadata" select="article-id"/>
<!-- only in 2.3 -->
<xsl:apply-templates mode="metadata" select="contract-num | contract-sponsor |
grant-num | grant-sponsor"/>
<xsl:apply-templates mode="metadata" select="funding-group/*">
<!-- includes (award-group*, funding-statement*,
open-access?) -->
</xsl:apply-templates>
</div>
</div>
</xsl:for-each>
</div>
</div>
<hr class="part-rule"/>
<!-- change context to front/article-meta (again) -->
<xsl:for-each select="article-meta | self::front-stub">
<div class="metadata centered">
<xsl:apply-templates mode="metadata" select="title-group"/>
</div>
<!-- contrib-group, aff, aff-alternatives, author-notes -->
<xsl:apply-templates mode="metadata" select="contrib-group"/>
<!-- back in article-meta or front-stub context -->
<xsl:if test="aff | aff-alternatives | author-notes">
<div class="metadata two-column table">
<div class="row">
<div class="cell empty"/>
<div class="cell">
<div class="metadata-group">
<xsl:apply-templates mode="metadata"
select="aff | aff-alternatives | author-notes"/>
</div>
</div>
</div>
</div>
</xsl:if>
<!-- abstract(s) -->
<xsl:if test="abstract | trans-abstract">
<!-- rule separates title+authors from abstract(s) -->
<hr class="section-rule"/>
<xsl:for-each select="abstract | trans-abstract">
<!-- title in left column, content (paras, secs) in right -->
<div class="metadata two-column table">
<div class="row">
<div class="cell" style="text-align: right">
<h4 class="callout-title">
<xsl:apply-templates select="title/node()"/>
<xsl:if test="not(normalize-space(string(title)))">
<span class="generated">
<xsl:if test="self::trans-abstract">Translated </xsl:if>
<xsl:text>Abstract</xsl:text>
</span>
</xsl:if>
</h4>
</div>
<div class="cell">
<xsl:apply-templates select="*[not(self::title)]"/>
</div>
</div>
</div>
</xsl:for-each>
<!-- end of abstract or trans-abstract -->
</xsl:if>
<!-- end of dealing with abstracts -->
</xsl:for-each>
<xsl:for-each select="notes">
<div class="metadata">
<xsl:apply-templates mode="metadata" select="."/>
</div>
</xsl:for-each>
<hr class="part-rule"/>
<!-- end of big front-matter pull -->
</xsl:template>
<xsl:template name="footer-metadata">
<!-- handles: article-categories, kwd-group, counts,
supplementary-material, custom-meta-group
Plus also generates a sheet of processing warnings
-->
<xsl:for-each select="front/article-meta | front-stub">
<xsl:if test="article-categories | kwd-group | counts |
supplementary-material | custom-meta-group |
custom-meta-wrap">
<!-- custom-meta-wrap is from NLM 2.3 -->
<hr class="part-rule"/>
<div class="metadata">
<h4 class="generated">
<xsl:text>Article Information (continued)</xsl:text>
</h4>
<div class="metadata-group">
<xsl:apply-templates mode="metadata"
select="supplementary-material"/>
<xsl:apply-templates mode="metadata"
select="article-categories | kwd-group | counts"/>
<xsl:apply-templates mode="metadata"
select="custom-meta-group | custom-meta-wrap"/>
</div>
</div>
</xsl:if>
</xsl:for-each>
<xsl:variable name="process-warnings">
<xsl:call-template name="process-warnings"/>
</xsl:variable>
<xsl:if test="normalize-space(string($process-warnings))">
<hr class="part-rule"/>
<div class="metadata one-column table">
<!--<div class="row">
<div class="cell spanning">
</div>
</div>-->
<div class="row">
<div class="cell spanning">
<h4 class="generated">
<xsl:text>Process warnings</xsl:text>
</h4>
<p>Warnings reported by the processor due to problematic markup follow:</p>
<div class="metadata-group">
<xsl:copy-of select="$process-warnings"/>
</div>
</div>
</div>
</div>
</xsl:if>
</xsl:template>
<!-- ============================================================= -->
<!-- METADATA PROCESSING -->
<!-- ============================================================= -->
<!-- Includes mode "metadata" for front matter, along with
"metadata-inline" for metadata elements collapsed into
inline sequences, plus associated named templates -->
<!-- WAS journal-meta content:
journal-id+, journal-title-group*, issn+, isbn*, publisher?,
notes? -->
<!-- (journal-id+, journal-title-group*, (contrib-group | aff | aff-alternatives)*,
issn+, issn-l?, isbn*, publisher?, notes*, self-uri*) -->
<xsl:template match="journal-id" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>Journal ID</xsl:text>
<xsl:for-each select="@journal-id-type">
<xsl:text> (</xsl:text>
<span class="data">
<xsl:value-of select="."/>
</span>
<xsl:text>)</xsl:text>
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="journal-title-group" mode="metadata">
<xsl:apply-templates mode="metadata"/>
</xsl:template>
<xsl:template match="issn" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>ISSN</xsl:text>
<xsl:call-template name="append-pub-type"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="issn-l" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>ISSN-L</xsl:text>
<xsl:call-template name="append-pub-type"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="isbn" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>ISBN</xsl:text>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="publisher" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Publisher</xsl:with-param>
<xsl:with-param name="contents">
<xsl:apply-templates select="publisher-name" mode="metadata-inline"/>
<xsl:apply-templates select="publisher-loc" mode="metadata-inline"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="publisher-name" mode="metadata-inline">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="publisher-loc" mode="metadata-inline">
<span class="generated"> (</span>
<xsl:apply-templates/>
<span class="generated">)</span>
</xsl:template>
<xsl:template match="notes" mode="metadata">
<xsl:call-template name="metadata-area">
<xsl:with-param name="label">Notes</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- journal-title-group content:
(journal-title*, journal-subtitle*, trans-title-group*,
abbrev-journal-title*) -->
<xsl:template match="journal-title" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Title</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="journal-subtitle" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Subtitle</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="trans-title-group" mode="metadata">
<xsl:apply-templates mode="metadata"/>
</xsl:template>
<xsl:template match="abbrev-journal-title" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Abbreviated Title</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- trans-title-group content: (trans-title, trans-subtitle*) -->
<xsl:template match="trans-title" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>Translated Title</xsl:text>
<xsl:for-each select="(../@xml:lang|@xml:lang)[last()]">
<xsl:text> (</xsl:text>
<span class="data">
<xsl:value-of select="."/>
</span>
<xsl:text>)</xsl:text>
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="trans-subtitle" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>Translated Subtitle</xsl:text>
<xsl:for-each select="(../@xml:lang|@xml:lang)[last()]">
<xsl:text> (</xsl:text>
<span class="data">
<xsl:value-of select="."/>
</span>
<xsl:text>)</xsl:text>
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!-- article-meta content:
(article-id*, article-categories?, title-group,
(contrib-group | aff)*, author-notes?, pub-date+, volume?,
volume-id*, volume-series?, issue?, issue-id*,
issue-title*, issue-sponsor*, issue-part?, isbn*,
supplement?, ((fpage, lpage?, page-range?) | elocation-id)?,
(email | ext-link | uri | product | supplementary-material)*,
history?, permissions?, self-uri*, related-article*,
abstract*, trans-abstract*,
kwd-group*, funding-group*, conference*, counts?,
custom-meta-group?) -->
<!-- In order of appearance... -->
<xsl:template match="ext-link" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>External link</xsl:text>
<xsl:for-each select="ext-link-type">
<xsl:text> (</xsl:text>
<span class="data">
<xsl:value-of select="."/>
</span>
<xsl:text>)</xsl:text>
</xsl:for-each>
</xsl:with-param>
<xsl:with-param name="contents">
<xsl:apply-templates select="."/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="email" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Email</xsl:with-param>
<xsl:with-param name="contents">
<xsl:apply-templates select="."/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="uri" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">URI</xsl:with-param>
<xsl:with-param name="contents">
<xsl:apply-templates select="."/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="self-uri" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>Self URI</xsl:text>
</xsl:with-param>
<xsl:with-param name="contents">
<a href="{@xlink:href}">
<xsl:choose>
<xsl:when test="normalize-space(string(.))">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@xlink:href"/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="product" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>Product Information</xsl:text>
</xsl:with-param>
<xsl:with-param name="contents">
<xsl:choose>
<xsl:when test="normalize-space(string(@xlink:href))">
<a>
<xsl:call-template name="assign-href"/>
<xsl:apply-templates/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="permissions" mode="metadata">
<xsl:apply-templates select="copyright-statement" mode="metadata"/>
<xsl:if test="copyright-year | copyright-holder">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Copyright</xsl:with-param>
<xsl:with-param name="contents">
<xsl:for-each select="copyright-year | copyright-holder">
<xsl:apply-templates/>
<xsl:if test="not(position()=last())">, </xsl:if>
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:apply-templates select="license" mode="metadata"/>
</xsl:template>
<xsl:template match="copyright-statement" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Copyright statement</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="copyright-year" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Copyright</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="license" mode="metadata">
<xsl:call-template name="metadata-area">
<xsl:with-param name="label">
<xsl:text>License</xsl:text>
<xsl:if test="@license-type | @xlink:href">
<xsl:text> (</xsl:text>
<span class="data">
<xsl:value-of select="@license-type"/>
<xsl:if test="@xlink:href">
<xsl:if test="@license-type">, </xsl:if>
<a>
<xsl:call-template name="assign-href"/>
<xsl:value-of select="@xlink:href"/>
</a>
</xsl:if>
</span>
<xsl:text>)</xsl:text>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="history/date" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>Date</xsl:text>
<xsl:for-each select="@date-type">
<xsl:choose>
<xsl:when test=".='accepted'"> accepted</xsl:when>
<xsl:when test=".='received'"> received</xsl:when>
<xsl:when test=".='rev-request'"> revision requested</xsl:when>
<xsl:when test=".='rev-recd'"> revision received</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:with-param>
<xsl:with-param name="contents">
<xsl:call-template name="format-date"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="pub-date" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>Publication date</xsl:text>
<xsl:call-template name="append-pub-type"/>
</xsl:with-param>
<xsl:with-param name="contents">
<xsl:call-template name="format-date"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="volume-info">
<!-- handles volume?, volume-id*, volume-series? -->
<xsl:if test="volume | volume-id | volume-series">
<xsl:choose>
<xsl:when test="not(volume-id[2]) or not(volume)">
<!-- if there are no multiple volume-id, or no volume, we make one line only -->
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Volume</xsl:with-param>
<xsl:with-param name="contents">
<xsl:apply-templates select="volume | volume-series"
mode="metadata-inline"/>
<xsl:apply-templates select="volume-id" mode="metadata-inline"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="volume | volume-id | volume-series"
mode="metadata"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template match="volume | issue" mode="metadata-inline">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="volume-id | issue-id" mode="metadata-inline">
<span class="generated">
<xsl:text> (</xsl:text>
<xsl:for-each select="@pub-id-type">
<span class="data">
<xsl:value-of select="."/>
</span>
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:text>ID: </xsl:text>
</span>
<xsl:apply-templates/>
<span class="generated">)</span>
</xsl:template>
<xsl:template match="volume-series" mode="metadata-inline">
<xsl:if test="preceding-sibling::volume">
<span class="generated">,</span>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="volume" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Volume</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="volume-id" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">
<xsl:text>Volume ID</xsl:text>
<xsl:for-each select="@pub-id-type">
<xsl:text> (</xsl:text>
<span class="data">
<xsl:value-of select="."/>
</span>
<xsl:text>)</xsl:text>
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="volume-series" mode="metadata">
<xsl:call-template name="metadata-labeled-entry">
<xsl:with-param name="label">Series</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="issue-info">
<!-- handles issue?, issue-id*, issue-title*, issue-sponsor*, issue-part?, supplement? -->
<xsl:variable name="issue-info"
select="issue | issue-id | issue-title |
issue-sponsor | issue-part"/>
<xsl:choose>
<xsl:when
test="$issue-info and not(issue-id[2] | issue-title[2] | issue-sponsor | issue-part)">
<!-- if there are only one issue, issue-id and issue-title and nothing else, we make one line only -->
<xsl:call-template name="metadata-labeled-entry">