-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbkef.xsl
1489 lines (1337 loc) · 56.3 KB
/
bkef.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" encoding="UTF-8"?>
<!--
BKEF 1.0 ~ XSLT 1.0
Background knowledge - visualisation of data matrix, particular attributes and their relationships
Author: Daniel Stastny
Date: 10/2009
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ds="http://keg.vse.cz/bkef"
xmlns:exsl="http://exslt.org/common" xmlns:func="http://exslt.org/functions" xmlns:keg="http://keg.vse.cz"
extension-element-prefixes="func exsl" exclude-result-prefixes="keg ds" version="1.0">
<!-- **** IMPORTANT SETTINGS **** -->
<xsl:output method="html" encoding="UTF-8" version="1.0" indent="yes"/>
<!-- ROOT -->
<!-- csspath is used only if header is created (contentOnly=1) -->
<!-- otherwise, the css should be automatically loaded, from something like
templates/rhuk_milkyway/css
-->
<xsl:param name="csspath" select="'xml/bkef/css/'"/>
<xsl:param name="jspath" select="'xml/bkef/js/'"/>
<xsl:param name="image-url" select="'xml/bkef/img/'"/>
<!-- LANGUAGE -->
<!-- en | cs -->
<xsl:param name="reportLang" select="'cs'"/>
<!-- CONTENT ONLY WITHOUT HEADER: 1 YES | 0 NO -->
<xsl:param name="contentOnly" select="1"/>
<xsl:param name="Matrix" select="1"/>
<!-- Webpage shall be in XHTML 1.0 Strict -->
<!-- <xsl:output method="xml" encoding="UTF-8" version="1.0"/> -->
<xsl:variable name="LocalizationDictionary" select="document('bkef/dict/BKEFdictionary.xml')"/>
<xsl:variable name="ContentTagsDictionary" select="document('bkef/dict/BKEFContentTagsDictionary.xml')"/>
<xsl:include href="includes.xsl"/>
<!-- INFLUENCES -->
<!-- Specific realisations of attribute influences -->
<xsl:variable name="someInfluence" select="'Some-influence'"/>
<xsl:variable name="positiveInfluence" select="'Positive-growth'"/>
<xsl:variable name="negativeInfluence" select="'Negative-growth'"/>
<xsl:variable name="positiveFrequency" select="'Positive-bool-growth'"/>
<xsl:variable name="negativeFrequency" select="'Negative-bool-growth'"/>
<xsl:variable name="positiveBoolean" select="'Double-bool-growth'"/>
<!-- <xsl:variable name="negativeBoolean" select="'Negative boolean'"/> -->
<xsl:variable name="functional" select="'Functional'"/>
<xsl:variable name="none" select="'None'"/>
<xsl:variable name="doNotCare" select="'Uninteresting'"/>
<xsl:variable name="unknown" select="'Unknown'"/>
<!--
******************************
MAIN BODY
******************************
-->
<xsl:template match="/ds:BKEF">
<xsl:choose>
<xsl:when test="$contentOnly">
<!-- DOCTYPE script PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" -->
<xsl:apply-templates select="/ds:BKEF" mode="body"/>
</xsl:when>
<xsl:otherwise>
<html>
<head>
<title>BKEF - <xsl:value-of select="//ds:Header/ds:Title"/></title>
<!-- Link to CSS file -->
<link rel="stylesheet" type="text/css" href="{$csspath}bkef.css"/>
</head>
<!-- <body class="bkef" onload="uvodniNastaveni();"> -->
<body class="bkef">
<xsl:apply-templates select="/ds:BKEF" mode="body"/>
</body>
</html>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/ds:BKEF" mode="body">
<script type="text/javascript" src="{$jspath}wz_tooltip.js"/>
<script type="text/javasvript">
window.onload = function() {
uvodniNastaveni();
}
</script>
<script type="text/javascript" src="{$jspath}influences.js">window.fg = jk;</script>
<!-- <xsl:if test="$contentOnly = 1"> -->
<!-- Link to CSS file -->
<!-- <link rel="stylesheet" type="text/css" href="{$csspath}style.css"/> -->
<!-- </xsl:if> -->
<div id="bkef">
<!-- JavaScript FOLDING -->
<script type="text/javascript">
// Folding of particular formats
function ShowHide(id) {
folding = document.getElementById(id).style;
folding.display = (folding.display == 'block')? 'none': 'block';
}
</script>
<!-- NAVIGATION BOX -->
<div id="navigation">
<h5>
<!-- <xsl:value-of select="document($dictpath)/BKEFDictionary/Strings/str[@lang=$reportLang and @name='Navigation']"/> -->
<!-- <xsl:copy-of select="keg:translate('Navigation',01)"/> -->
<xsl:copy-of select="keg:translate('Navigace',1)"/>
<span class="folding" onclick="ShowHide('{generate-id()}')">+</span>
</h5>
<div id="{generate-id()}" class="hidden">
<ul class="nav">
<li>
<a href="#metaAttr">
<xsl:attribute name="title">
<xsl:copy-of select="keg:translate('Meta attributes',2)"/>
</xsl:attribute>
<xsl:copy-of select="keg:translate('Meta attributes',2)"/>
</a>
</li>
<li>
<a href="#definedInfluences">
<xsl:attribute name="title">
<xsl:copy-of select="keg:translate('Defined mutual influences',39)"/>
</xsl:attribute>
<xsl:copy-of select="keg:translate('Defined mutual influences',39)"/>
</a>
</li>
<li>
<a href="#influences">
<xsl:attribute name="title">
<xsl:copy-of select="keg:translate('Mutual influences',3)"/>
</xsl:attribute>
<xsl:copy-of select="keg:translate('Mutual influences',3)"/>
</a>
</li>
</ul>
<h6>
<xsl:copy-of select="keg:translate('Meta attributes',2)"/>
</h6>
<xsl:for-each select="ds:MetaAttributes//ds:MetaAttribute[@level=1]">
<ul class="nav">
<li>
<span class="strong">
<a href="#attribute-detail-{generate-id(current())}"
title="{@id}">
<xsl:value-of select="@name"/>
</a>
</span>
<xsl:if test="current()/ds:ChildMetaAttribute[@id]">
<ul class="nav2">
<xsl:for-each select="child::*[@id]">
<xsl:variable name="metaAttribute-name" select="@id"/>
<xsl:variable name="metaAttribute"
select="//ds:MetaAttribute[@id = $metaAttribute-name and @name and @level=0]/@name"/>
<li>
<input type="checkbox" value="{$metaAttribute}"
onClick="ShowHideAll(this.value);solveLocation();"/>
<xsl:variable name="idChildNavigation">
<xsl:value-of select="@id"/>
</xsl:variable>
<a
href="#attribute-detail-{generate-id(//ds:MetaAttribute[@name and @id=$idChildNavigation and @level])}"
title="{//ds:MetaAttribute[@name and @id=$idChildNavigation and @level]/@name}">
<xsl:value-of
select="//ds:MetaAttribute[@name and @id=$idChildNavigation and @level]/@name"
/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</ul>
</xsl:for-each>
</div>
</div>
<!-- MAIN PAGE -->
<div id="header">
<h1>BKEF <xsl:value-of select="//ds:Header/ds:Title"/></h1>
</div>
<div id="content">
<!-- Following order is changeable -->
<h2>
<a name="metaAttr">
<xsl:copy-of select="keg:translate('Meta attributes',2)"/>
</a>
</h2>
<!-- <p><button class="LMA"><xsl:copy-of select="keg:translate('+',41)"/></button></p> -->
<div class="MA">
<xsl:apply-templates select="ds:MetaAttributes"/>
<!-- <script>
var count = 0;
$("button").click(function () {
$("div.MA").toggle( count++ % 2 == 0 );
});
</script> -->
</div>
<h2>
<a name="definedInfluences">
<xsl:copy-of select="keg:translate('Defined mutual influences',39)"/>
</a>
</h2>
<xsl:call-template name="ds:tableMI"/>
<h2>
<a name="influences">
<xsl:copy-of select="keg:translate('Mutual influences',3)"/>
</a>
</h2>
<div id="bkef-matrix">
<div id="content-matrix">
<div id="tableOverflow">
<!-- <xsl:attribute name="style">overflow: auto; height: <xsl:value-of
select="5.25 * count(//ds:MetaAttribute[@name and @id and not(@role) and @level =
0]/@name) + 21.25"/>em</xsl:attribute> -->
<table class="matrix">
<tr>
<td class="attr">
<em><xsl:copy-of select="keg:translate('Attributes',35)"/></em>
</td>
<!-- 1st ROW of matrix // Generating of matrix with use of the list of meta-attributes -->
<xsl:for-each select="//ds:MetaAttribute[@name and @id and not(@role) and @level = 0]">
<xsl:variable name="name-metaAttr1a" select="current()/@name"></xsl:variable>
<xsl:variable name="metaAttribute1a" select="//ds:MetaAttribute[@name = $name-metaAttr1a and not (@role)]/@name"/>
<td class="attr" name="{$metaAttribute1a}" style="display:none;">
<xsl:value-of select="current()/@name"/>
<br/>
</td>
</xsl:for-each>
</tr>
<!-- OUTER ITERATION -->
<xsl:for-each select="//ds:MetaAttribute[@name and @id and not(@role) and @level = 0]">
<xsl:variable name="name-metaAttr1b" select="current()/@name"></xsl:variable>
<xsl:variable name="metaAttribute1b" select="//ds:MetaAttribute[@name = $name-metaAttr1b and not (@role)]/@name"/>
<tr name="{$metaAttribute1b}" style="display:none;">
<td class="attr">
<a href="#attribute-detail-{generate-id(current())}">
<xsl:value-of select="current()/@name"/>
</a>
</td>
<!-- 1st VAR // Actual value from 1st iteration block -->
<xsl:variable name="attribute" select="current()/@name"/>
<!-- INNER ITERATION -->
<xsl:for-each select="//ds:MetaAttribute[@name and @id and not(@role) and @level = 0]">
<!-- 2nd VAR // Actual value from 2nd iteration block -->
<xsl:variable name="attributeII" select="current()/@name"/>
<xsl:choose>
<xsl:when
test="//ds:Influence/ds:MetaAttribute[@role = 'A' and @name = $attribute] and //ds:Influence/ds:MetaAttribute[@role = 'B' and @name = $attributeII]">
<xsl:variable name="selectAttribute"
select="//ds:Influence
[child::ds:MetaAttribute[@role = 'A' and @name = $attribute] and child::ds:MetaAttribute[@role = 'B' and @name = $attributeII]]
/@type"/>
<xsl:choose>
<!-- THERE CAN BE SOME UNDEFINED INFLUENCE -->
<xsl:when test="$selectAttribute = $someInfluence">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'someInfluence'"/>
</xsl:call-template>
</xsl:when>
<!-- POSITIVE GROWTH -->
<xsl:when test="$selectAttribute = $positiveInfluence">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'positiveInfluence'"/>
</xsl:call-template>
</xsl:when>
<!-- NEGATIVE GROWTH -->
<xsl:when test="$selectAttribute = $negativeInfluence">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'negativeInfluence'"/>
</xsl:call-template>
</xsl:when>
<!-- POSITIVE BOOLEAN GROWTH -->
<xsl:when test="$selectAttribute = $positiveFrequency">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'positiveFrequency'"/>
</xsl:call-template>
</xsl:when>
<!-- NEGATIVE BOOLEAN GROWTH -->
<xsl:when test="$selectAttribute = $negativeFrequency">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'negativeFrequency'"/>
</xsl:call-template>
</xsl:when>
<!-- POSITIVE DOUBLE BOOLEAN -->
<xsl:when test="$selectAttribute = $positiveBoolean">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'positiveBoolean'"/>
</xsl:call-template>
</xsl:when>
<!-- NEGATIVE BOOLEAN - JUST PREPARED FOR EVENTUAL USAGE -->
<!-- <xsl:when test="$selectAttribute = $negativeBoolean">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'negativeBoolean'"/>
</xsl:call-template>
</xsl:when> -->
<!-- FUNCTIONAL INFLUENCE -->
<xsl:when test="$selectAttribute = $functional">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'functional'"/>
</xsl:call-template>
</xsl:when>
<!-- NONE INFLUENCE -->
<xsl:when test="$selectAttribute = $none">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'none'"/>
</xsl:call-template>
</xsl:when>
<!-- WE ARE NOT INTERESTED ABOUT INFLUENCE -->
<xsl:when test="$selectAttribute = $doNotCare">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'doNotCare'"/>
</xsl:call-template>
</xsl:when>
<!-- UNKNOWN -->
<xsl:when test="$selectAttribute = $unknown">
<xsl:call-template name="ds:Cell">
<xsl:with-param name="selectAttribute" select="$selectAttribute"/>
<xsl:with-param name="attribute" select="$attribute"/>
<xsl:with-param name="attributeII" select="$attributeII"/>
<xsl:with-param name="imgName" select="'unknown'"/>
</xsl:call-template>
</xsl:when>
<!-- "Gray" field - intersection of same attributes -->
<xsl:when test="$attribute = $attributeII">
<xsl:variable name="name-metaAttr" select="current()/@name"></xsl:variable>
<xsl:variable name="metaAttribute2" select="//ds:MetaAttribute[@name = $name-metaAttr and not (@role)]/@name"/>
<td class="cannotMatch" name="{$metaAttribute2}" style="display:none;">
<p class="displayNone">XXX</p>
</td>
</xsl:when>
<!-- Not set -->
<xsl:otherwise>
<xsl:variable name="name-metaAttr" select="current()/@name"></xsl:variable>
<xsl:variable name="metaAttribute2" select="//ds:MetaAttribute[@name = $name-metaAttr and not (@role)]/@name"/>
<td name="{$metaAttribute2}" style="display:none;">
<img src="{$image-url}notSet.png" alt="Not set"/>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- Intersection of the same attributes -->
<xsl:when test="$attribute = $attributeII">
<xsl:variable name="name-metaAttr" select="current()/@name"></xsl:variable>
<xsl:variable name="metaAttribute2" select="//ds:MetaAttribute[@name = $name-metaAttr and not (@role)]/@name"/>
<td class="cannotMatch" name="{$metaAttribute2}" style="display:none;">
<p class="displayNone">XXX</p>
</td>
</xsl:when>
<!-- The cell value is not set -->
<xsl:otherwise>
<xsl:variable name="name-metaAttr" select="current()/@name"></xsl:variable>
<xsl:variable name="metaAttribute2" select="//ds:MetaAttribute[@name = $name-metaAttr and not (@role)]/@name"/>
<td name="{$metaAttribute2}" style="display:none;">
<img src="{$image-url}notSet.png" alt="Not set"/>
</td>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</div>
</div>
</div>
<!-- ******************************* -->
</div>
<!-- Footer -->
<p>2009 Daniel Šťastný</p>
<p>
<small> ~ Valid XHTML 1.0 Strict ~ </small>
</p>
</div>
</xsl:template>
<!--
******************************
METAATTRIBUTES
******************************
-->
<xsl:template match="ds:MetaAttributes">
<!-- PARENTED BOXES OF METAATTRIBUTES -->
<xsl:for-each select="//ds:MetaAttribute[@name and @id and @level=1]">
<xsl:comment><xsl:value-of select="keg:getContentBlockTag('Metaattribute',@name,'start')"/></xsl:comment>
<div class="metaAttributeBox">
<h3>
<a name="attribute-detail-{generate-id(current())}"><xsl:value-of select="@name"
/></a> [id <xsl:value-of select="@id"/> ~ <xsl:copy-of
select="keg:translate('level',5)"/>
<xsl:value-of select="@level"/>] </h3>
<xsl:apply-templates select="ds:Annotation">
<xsl:with-param name="type">Group Metaattribute</xsl:with-param>
<xsl:with-param name="name" select="@name"></xsl:with-param>
</xsl:apply-templates>
<xsl:for-each select="current()//child::ds:ChildMetaAttribute[@id]">
<!-- Link with the mutual-influences matrix -->
<xsl:variable name="idChild">
<xsl:value-of select="current()/@id"/>
</xsl:variable>
<div class="metaAttributeBox">
<h3>
<a
name="attribute-detail-{generate-id(//ds:MetaAttribute[@name and @id=$idChild and @level])}"
><xsl:value-of
select="//ds:MetaAttribute[@name and @id = $idChild and @level]/@name"
/> [id <xsl:value-of
select="//ds:MetaAttribute[@name and @id = $idChild and @level]/@id"
/>]</a>
</h3>
<xsl:if test="//ds:MetaAttribute[@name and @id=$idChild and @level=0]">
<xsl:apply-templates
select="//ds:MetaAttribute[@name and @id=$idChild and @level]"/>
</xsl:if>
<xsl:if
test="//ds:MetaAttribute[@name and @id=$idChild and @level=0]/ds:Formats">
<xsl:apply-templates
select="//ds:MetaAttribute[@name and @id=$idChild and @level]/ds:Formats">
<xsl:with-param name="UID" select="generate-id()"/>
</xsl:apply-templates>
</xsl:if>
</div>
</xsl:for-each>
</div>
<xsl:comment><xsl:value-of select="keg:getContentBlockTag('Metaattribute',@name,'end')"/></xsl:comment>
</xsl:for-each>
</xsl:template>
<!--
******************************
Additional definitions
******************************
-->
<!-- **** META-ATTRIBUTE DETAIL **** -->
<xsl:template match="ds:MetaAttribute[@name and @id and @level]">
<!-- <xsl:param name="linkParent"/> -->
<ul>
<xsl:if test="ds:Author">
<li>
<span class="item"><xsl:copy-of select="keg:translate('Author',6)"/>: </span>
<xsl:value-of select="ds:Author"/>
</li>
</xsl:if>
<!-- Call ANNOTATION -->
<li>
<span class="item">
<xsl:copy-of select="keg:translate('Annotation',8)"/>
</span>
<xsl:apply-templates select="ds:Annotation">
<xsl:with-param name="type">Metaattribute</xsl:with-param>
<xsl:with-param name="name" select="@name"></xsl:with-param>
</xsl:apply-templates>
</li>
<!-- <xsl:if test="ds:ParentMetaattribute">
<li>
<span class="item"><xsl:copy-of select="keg:translate('Parent-metaattribute',9)"/>: </span>
<xsl:value-of select="ds:ParentMetaattribute"/>
</li>
</xsl:if>
-->
<xsl:if test="ds:Variability">
<li>
<span class="item"><xsl:copy-of select="keg:translate('Variability',10)"/>: </span>
<xsl:value-of select="ds:Variability"/>
</li>
</xsl:if>
</ul>
</xsl:template>
<!-- ***** FORMATS ***** -->
<xsl:template match="ds:MetaAttribute[@name and @id and @level]/ds:Formats">
<xsl:param name="UID" select="generate-id()"/>
<!-- Boxes of particular formats -->
<div class="formatsBox">
<!-- Web-Folding of particular formats -->
<!-- Search for childs and making toggle menu -->
<xsl:if test="child::*">
<h4>
<xsl:copy-of select="keg:translate('Formats',11)"/>
<span class="folding" onclick="ShowHide('{$UID}')">+</span>
</h4>
</xsl:if>
<div id="{$UID}" class="hidden">
<xsl:for-each select="current()//ds:Format">
<!-- BASIC DETAILS -->
<div class="formatBox">
<h5><xsl:copy-of select="keg:translate('Name',12)"/>: <xsl:value-of
select="@name"/></h5>
<ul>
<xsl:if test="ds:Author">
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Author-format',7)"/>: </span>
<xsl:value-of select="ds:Author"/>
</li>
</xsl:if>
<xsl:if test="ds:Annotation">
<li>
<span class="item">
<xsl:copy-of select="keg:translate('Annotation',8)"/>
</span>
<ul>
<li><xsl:copy-of select="keg:translate('Author',6)"/>:
<xsl:value-of select="ds:Annotation/ds:Author"
/></li>
<li>
<xsl:value-of select="ds:Annotation/ds:Text"/>
</li>
</ul>
</li>
</xsl:if>
<xsl:if test="ds:DataType">
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Data type',13)"/>: </span>
<xsl:value-of select="ds:DataType"/>
</li>
</xsl:if>
<xsl:if test="ds:ValueType">
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Value type',14)"/>: </span>
<xsl:value-of select="ds:ValueType"/>
</li>
</xsl:if>
</ul>
<!-- VALUE ANNOTATIONS -->
<xsl:if test="ds:ValueAnnotations">
<h6>
<xsl:copy-of select="keg:translate('Value annotations',15)"/>
</h6>
<!-- Show annotations in table -->
<table class="annotations">
<tr>
<td>
<span class="item">
<xsl:copy-of select="keg:translate('Value',16)"/>
</span>
</td>
<td>
<span class="item">
<xsl:copy-of select="keg:translate('Annotation',8)"/>
</span>
</td>
</tr>
<xsl:for-each select="ds:ValueAnnotations//ds:ValueAnnotation">
<tr>
<td>
<xsl:value-of select="ds:Value"/>
</td>
<td>
<xsl:apply-templates select="ds:Annotation">
<xsl:with-param name="type">Value Annotation</xsl:with-param>
<xsl:with-param name="name" select="ds:Value"></xsl:with-param>
</xsl:apply-templates>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:if>
<!-- ALLOWED RANGE -->
<xsl:if test="ds:AllowedRange">
<h6>
<xsl:copy-of select="keg:translate('Allowed range',17)"/>
</h6>
<xsl:choose>
<!-- **** Enumeration -->
<xsl:when test="ds:AllowedRange/ds:Enumeration">
<span class="item">
<xsl:copy-of select="keg:translate('Enumeration',18)"/>
</span>
<ul>
<xsl:for-each
select="ds:AllowedRange/ds:Enumeration//ds:Value">
<li>
<xsl:value-of select="current()"/>
</li>
</xsl:for-each>
</ul>
</xsl:when>
<!-- **** Interval -->
<xsl:when test="ds:AllowedRange/ds:Interval">
<!-- Left side of an interval -->
<p>
<span class="item">
<xsl:copy-of select="keg:translate('Interval',19)"/>
</span>
<span class="interval">
<xsl:choose>
<xsl:when
test="ds:AllowedRange/ds:Interval/ds:LeftBound/@type = 'open'"
> (<xsl:value-of
select="ds:AllowedRange/ds:Interval/ds:LeftBound/@value"
/>; </xsl:when>
<xsl:when
test="ds:AllowedRange/ds:Interval/ds:LeftBound/@type = 'closed'"
> <<xsl:value-of
select="ds:AllowedRange/ds:Interval/ds:LeftBound/@value"
/>; </xsl:when>
</xsl:choose>
<!-- Right side of an interval -->
<xsl:choose>
<xsl:when
test="ds:AllowedRange/ds:Interval/ds:RightBound/@type = 'open'">
<xsl:value-of
select="ds:AllowedRange/ds:Interval/ds:RightBound/@value"
/>) </xsl:when>
<xsl:when
test="ds:AllowedRange/ds:Interval/ds:RightBound/@type = 'closed'">
<xsl:value-of
select="ds:AllowedRange/ds:Interval/ds:RightBound/@value"
/>> </xsl:when>
</xsl:choose>
</span>
</p>
</xsl:when>
</xsl:choose>
</xsl:if>
<!-- COLLATION -->
<xsl:if test="ds:Collation">
<h6>
<xsl:copy-of select="keg:translate('Collation',20)"/>
</h6>
<xsl:choose>
<xsl:when
test="ds:Collation[@type = 'Numerical' or @type = 'Alphabetical']">
<ul>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Type-collation',21)"/>: </span>
<xsl:value-of select="ds:Collation/@type"/>
</li>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Sense',22)"/>: </span>
<xsl:value-of select="ds:Collation/@sense"/>
</li>
</ul>
</xsl:when>
<xsl:when test="ds:Collation[@type = 'Enumeration']">
<ul>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Type-collation',21)"/>: </span>
<xsl:value-of select="ds:Collation/@type"/>
</li>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Sense',22)"/>: </span>
<xsl:value-of select="ds:Collation/@sense"/>
</li>
</ul>
<span class="item">
<xsl:copy-of select="keg:translate('Values',23)"/>
</span>
<ul>
<xsl:for-each select="ds:Collation//ds:Value">
<li>
<xsl:value-of select="current()"/>
</li>
</xsl:for-each>
</ul>
</xsl:when>
</xsl:choose>
</xsl:if>
<!-- PREPROCESSING HINTS -->
<xsl:if test="ds:PreprocessingHints">
<h6>
<xsl:copy-of select="keg:translate('Preprocessing hints',24)"/>
</h6>
<!-- Choose all Preprocessing hints -->
<xsl:for-each select=".//ds:PreprocessingHint">
<p>
<span class="item"><xsl:copy-of select="keg:translate('Name',12)"
/>: </span>
<xsl:value-of select="@name"/>
</p>
<p>
<span class="item">
<strong>
<xsl:copy-of select="keg:translate('Characteristics',25)"
/>
</strong>
</span>
</p>
<!-- Choose all discretization hints -->
<xsl:for-each select=".//ds:DiscretizationHint">
<xsl:choose>
<!-- *** Exhaustive enumeration -->
<xsl:when test="ds:ExhaustiveEnumeration">
<xsl:for-each select=".//ds:Bin">
<div class="bin">
<p>
<strong>
<xsl:copy-of select="keg:translate('Value',16)"/>
</strong>
</p>
<ul>
<xsl:for-each select=".//ds:Value">
<li>
<xsl:value-of select="current()"/>
</li>
</xsl:for-each>
</ul>
<hr/>
<p>
<xsl:apply-templates select="ds:Annotation">
<xsl:with-param name="type">Exhaustive Enumeration</xsl:with-param>
<xsl:with-param name="name" select="@name"></xsl:with-param>
</xsl:apply-templates>
</p>
</div>
</xsl:for-each>
</xsl:when>
<!-- ***
Combination of two different intervals catching extreme values
and equidistant-interval steps
Interval enumeration + Equidistant
-->
<xsl:when test="count(child::text()) = 3">
<span class="item">
<xsl:copy-of select="keg:translate('Intervals',26)"/>
</span>
<xsl:for-each select=".//ds:IntervalBin">
<div class="bin">
<p>
<xsl:value-of select="@name"/>
</p>
<xsl:call-template name="ds:Interval"/>
</div>
</xsl:for-each>
<span class="item">
<xsl:copy-of select="keg:translate('Equidistant',27)"
/>
</span>
<ul>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Range',29)"/>: </span>
<xsl:call-template name="ds:Equidistant"/>
</li>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Step',29)"/>: </span>
<xsl:value-of select="ds:Equidistant/ds:Step"/>
</li>
</ul>
</xsl:when>
<!-- *** Equidistant -->
<xsl:when test="ds:Equidistant">
<span class="item">
<xsl:copy-of select="keg:translate('Equidistant',27)"
/>
</span>
<ul>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Range',28)"/>: </span>
<xsl:call-template name="ds:Equidistant"/>
</li>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Step',29)"/>: </span>
<xsl:value-of select="ds:Equidistant/ds:Step"/>
</li>
</ul>
</xsl:when>
<!-- *** EquifrequentInterval -->
<xsl:when test="ds:EquifrequentInterval">
<span class="item">
<xsl:copy-of
select="keg:translate('Equifrequent interval',30)"
/>
</span>
<ul>
<li>
<span class="item"><xsl:copy-of
select="keg:translate('Count',31)"/>: </span>
<xsl:value-of
select="ds:EquifrequentInterval/ds:Count"/>
</li>
</ul>
</xsl:when>
<!-- *** IntervalEnumeration -->
<xsl:when test="ds:IntervalEnumeration">
<span class="item">
<xsl:copy-of select="keg:translate('Intervals',26)"/>
</span>
<xsl:for-each select=".//ds:IntervalBin">
<div class="bin">
<p>
<xsl:value-of select="@name"/>
</p>
<xsl:call-template name="ds:Interval"/>
</div>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
<!-- VALUE DESCRIPTIONS -->
<xsl:if test="ds:ValueDescriptions">
<h6>
<xsl:copy-of select="keg:translate('Value descriptions',32)"/>
</h6>
<xsl:for-each select=".//ds:ValueDescription">
<div class="bin">
<span class="item"><xsl:copy-of
select="keg:translate('Type-desc',33)"/>: </span>
<xsl:value-of select="@type"/>
<xsl:choose>
<xsl:when test="child::ds:Value[1]">
<ul>
<xsl:for-each select="ds:Value">
<li>
<xsl:value-of select="current()"/>
</li>
</xsl:for-each>
</ul>
</xsl:when>
<xsl:when test="child::ds:Interval[1]">
<xsl:call-template name="ds:Interval"/>
</xsl:when>
</xsl:choose>
<hr/>
<xsl:apply-templates select="ds:Annotation">
<xsl:with-param name="type">Value Description</xsl:with-param>
<xsl:with-param name="name" select="@type"></xsl:with-param>
</xsl:apply-templates>
</div>
</xsl:for-each>
</xsl:if>
</div>
</xsl:for-each>
</div>
</div>
</xsl:template>
<!-- **** INTERVAL **** -->
<xsl:template name="ds:Interval">
<ul>
<!-- Interval -->
<xsl:for-each select=".//ds:Interval">
<li>
<span class="interval">
<xsl:choose>
<!-- left bound -->
<xsl:when test="current()/ds:LeftBound/@type = 'closed'">
<<xsl:value-of select="current()/ds:LeftBound/@value"/>
</xsl:when>
<xsl:when test="current()/ds:LeftBound/@type = 'open'"> (<xsl:value-of
select="current()/ds:LeftBound/@value"/>
</xsl:when>
</xsl:choose>
<!-- Interval semicolon -->
<xsl:text>;</xsl:text>
<xsl:choose>
<!-- right bound -->
<xsl:when test="current()/ds:RightBound/@type = 'closed'">
<xsl:value-of select="current()/ds:RightBound/@value"/>> </xsl:when>
<xsl:when test="current()/ds:RightBound/@type = 'open'">
<xsl:value-of select="current()/ds:RightBound/@value"/>) </xsl:when>
</xsl:choose>
</span>
</li>
</xsl:for-each>
</ul>
</xsl:template>