-
Notifications
You must be signed in to change notification settings - Fork 1
/
Renderer.xslt
3134 lines (3032 loc) · 400 KB
/
Renderer.xslt
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"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg">
<xsl:output method="xml" encoding="iso-8859-1" doctype-system="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" doctype-public="-//W3C//DTD SVG 1.1//EN" indent="yes"/>
<!-- Root -->
<xsl:template match="RuleML">
<svg id="rootSVG" version="1.1" xmlns="http://www.w3.org/2000/svg" > <!-- Start SVG -->
<defs>
<!-- Arrow head -->
<marker id="arrow" viewBox="0 0 15 15" refX="1" refY="6" markerUnits="strokeWidth" markerWidth="10" markerHeight="7" orient="auto">
<path d="M0 1 L10 6 L0 11 L10 6 L0 6" style="stroke:black;stroke-width:2;fill:none;" />
</marker>
<!-- Variable Pattern -->
<pattern id="hatched" patternTransform="rotate(45) " x="0" y="0" width="3.5" height="3.5" patternUnits="userSpaceOnUse" >
<path d="M 0 0 l 0 3.5" fill="none" stroke="#01A9DB" stroke-width="1" stroke-linecap="square"/>
</pattern>
</defs>
<xsl:call-template name="Initialize"/> <!-- Knowledgebase -->
<script type="text/javascript">
document.getElementById('rootSVG').setAttribute('height', parseFloat(coordY));
document.getElementById('rootSVG').setAttribute('width', parseFloat(maxCoordX) + horizSpace);
</script>
</svg> <!-- End SVG -->
</xsl:template>
<!-- Applies all templates to Datalog, Hornlog RuleML/XML files without RuleML namespace and schema -->
<xsl:template name="Initialize">
<!-- Variables used to determine the maximum height and width of the SVG viewport and for all widths-->
<!-- Variables used to determine the position and size of the SVG elements, length of strings found in nodes -->
<script type="text/javascript">
var maxCoordX = 70;
var horizSpace = 60;
var horizSpaceFunct = 16;
var coordX = 70;
var coordY = 120;
var serializer = new XMLSerializer();
var stringTemp = new String;
var stringCompare = new String;
var stringStart;
var stringEnd;
</script>
<xsl:apply-templates select="Assert"/>
</xsl:template>
<xsl:template match="Assert">
<xsl:apply-templates/> <!-- <Implies>, <And>, <Atom>, <Equal>, <Expr> tags are possible -->
</xsl:template>
<!-- Rule: executes template for each Implies node -->
<xsl:template match="Implies">
<!-- Single-premise Rule: Atom Implies Atom -->
<xsl:if test="(count(current()/child::Atom))=2">
<!-- Positions and counts of elements -->
<xsl:variable name="positionImplies" select="count(current()/preceding-sibling::*) + 1"/>
<xsl:variable name="countAtoms" select="count(current()/child::Atom)"/>
<xsl:variable name="countContentAtom1" select="count(current()/child::Atom[position()=1]/child::*)"/>
<xsl:variable name="countContentAtom2" select="count(current()/child::Atom[position()=2]/child::*)"/>
<!-- Implies double_arrow -->
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:2;fill:none</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:apply-templates select="Atom[position()=1]"/> <!-- Single-premise of the rule Atom Implies Atom -->
<!-- Rounded rectangle 1 -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>x) - 20);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>y) - 60);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),$countContentAtom1)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),$countContentAtom1)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 1st rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) - 50);
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('x');
coordY = coordY + 45;
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width);}
</script>
<xsl:apply-templates select="Atom[position()=2]"/> <!-- Head of the rule -->
<!-- Rounded rectangle 2 + double arrow -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,1)"/>x) - 20);
<!-- Determine starting y coordinate for 2nd rounded rectangle using the start position and height of the 1st rounded rectangle -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 32);
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,$countContentAtom2)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,$countContentAtom2)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 2nd rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y) - 15);
coordY=coordY+120;
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a = parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>x) + 5;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c = <xsl:value-of select= "concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/> = 'M ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r + '';
document.getElementById('<xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>').setAttribute('d', <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>);
coordY=coordY+25;
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width);}
</script>
</xsl:if>
<!-- Single-premise Rule Equal Implies Equal -->
<xsl:if test="(count(current()/child::Equal))=2">
<!-- Positions and counts of elements -->
<xsl:variable name="positionImplies" select="count(current()/preceding-sibling::*) + 1"/>
<xsl:variable name="countEquals" select="count(current()/child::Equal)"/>
<xsl:variable name="countContentEqual1" select="count(current()/child::Equal[position()=1]/child::*)"/>
<xsl:variable name="countContentEqual2" select="count(current()/child::Equal[position()=2]/child::*)"/>
<!-- Implies double_arrow -->
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:2;fill:none</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:apply-templates select="Equal[position()=1]"/> <!-- Single-premise of the rule-->
<!-- Rounded rectangle 1 -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),1)"/>x) - 20);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),1)"/>y) - 95);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),$countContentEqual1)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),$countContentEqual1)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 1st rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) -50);
coordY=coordY+45;
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('height');
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width);}
</script>
<xsl:apply-templates select="Equal[position()=2]"/> <!-- Head of the rule -->
<!-- Rounded rectangle 2 + double arrow -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countEquals,1)"/>x) - 20);
<!-- Determine starting y coordinate for 2nd rounded rectangle using the starting position and height of the 1st rounded rectangle -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 32);
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('y');
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countEquals,$countContentEqual2)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countEquals,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countEquals,$countContentEqual2)"/>length) + 40);
<!-- Determine height of 2nd rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y) - 50);
coordY=coordY+120;
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a = parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),1)"/>x) + 5;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/> = 'M ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r + '';
document.getElementById('<xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>').setAttribute('d', <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>);
coordY=coordY+25;
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width);}
</script>
</xsl:if> <!-- Single-premise Rule Equal Implies Equal -->
<!-- Single Premise Rule: Implies has child Atom and Equal -->
<xsl:if test="count(current()/child::Equal)=1 and count(current()/child::Atom)=1"> <!-- Single-premise rule -->
<!-- Positions and counts of elements -->
<xsl:variable name="positionImplies" select="count(current()/preceding-sibling::*) + 1"/>
<xsl:variable name="countAtoms" select="(count(current()/child::*))"/>
<xsl:variable name="countEquals" select="(count(current()/child::*))"/>
<!-- Implies double_arrow -->
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:2;fill:none</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<!-- If Single Premise of Rule is Atom -->
<xsl:if test="count(current()/child::Atom/preceding-sibling::*) = 0">
<!-- Positions and counts of elements -->
<xsl:variable name="countContentAtom1" select="count(current()/child::Atom[position()=1]/child::*)"/>
<xsl:apply-templates select="Atom"/> <!-- Single-premise of the rule-->
<!-- Rounded rectangle 1 -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>x) - 20);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>y) - 50);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),$countContentAtom1)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),$countContentAtom1)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 1st rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) - 50);
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('x');
coordY = coordY + 45;
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width);}
</script>
</xsl:if> <!-- If Single Premise of Rule is Atom -->
<!-- If Single Premise of Rule is Equal -->
<xsl:if test="count(current()/child::Equal/preceding-sibling::*) = 0">
<!-- Positions and counts of elements -->
<xsl:variable name="countContentEqual1" select="count(current()/child::Equal[position()=1]/child::*)"/>
<xsl:apply-templates select="Equal"/> <!-- Single-premise of the rule-->
<!-- Rounded rectangle 1 -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),1)"/>x) - 20);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),1)"/>y) - 55);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),$countContentEqual1)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countEquals*1)-1),$countContentEqual1)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 1st rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) -50);
coordY=coordY+45;
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('height');
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width);}
</script>
</xsl:if> <!-- Single Premise of Rule is Equal -->
<xsl:if test= "count(current()/child::Atom/preceding-sibling::*) = 1">
<!-- Positions and counts of elements -->
<xsl:variable name="countContentAtom2" select="count(current()/child::Atom/child::*)"/>
<xsl:apply-templates select="Atom"/> <!-- Conclusion of the rule -->
<!-- Rounded rectangle 2 + double arrow -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,1)"/>x) - 20);
<!-- Determine starting y coordinate for 2nd rounded rectangle using the starting position and height of the 1st rounded rectangle -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 32);
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,$countContentAtom2)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,$countContentAtom2)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 2nd rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y)-15);
coordY=coordY+120;
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a = parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>x) + 5;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/> = 'M ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r + '';
document.getElementById('<xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>').setAttribute('d', <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>);
coordY=coordY+25;
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width);}
</script>
</xsl:if> <!-- If conclusion of rule is Atom -->
<xsl:if test="count(current()/child::Equal/preceding-sibling::*) = 1">
<!-- Positions and counts of elements -->
<xsl:variable name="countContentEqual2" select="count(current()/child::Equal/child::*)"/>
<xsl:apply-templates select="Equal"/> <!-- Conclusion of the rule is Equal-->
<!-- Rounded rectangle 2 + double arrow -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,1)"/>x) - 20);
<!-- Determine starting y coordinate for 2nd rounded rectangle using the starting position and height of the 1st rounded rectangle -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 32);
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,$countContentEqual2)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,$countAtoms,$countContentEqual2)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 2nd rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y) -50);
coordY=coordY+120;
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a = parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,(($countAtoms*1)-1),1)"/>x) + 5;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/> = 'M ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r + '';
document.getElementById('<xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>').setAttribute('d', <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>);
coordY=coordY+25;
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width);}
</script>
</xsl:if> <!-- If conclusion of rule is Equal -->
</xsl:if> <!-- Single Premise Rule: Implies has child Atom and Equal -->
<!-- Multi-premise rule -->
<!-- Premise containing more than one Atom and/or Equal, conclusion of the rule is Equal -->
<xsl:if test="(count(current()/child::Equal))=1 and (count(current()/child::And))=1">
<!-- Positions and counts of elements -->
<xsl:variable name="positionImplies" select="count(current()/preceding-sibling::*) + 1"/>
<xsl:variable name="countEqualsInAnd" select="count(current()/child::And/child::*)"/>
<xsl:variable name="countContentEqual" select="count(current()/child::Equal/child::*)"/>
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:2;fill:none</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:apply-templates select="And"/> <!-- Multi-premise of the rule -->
<!-- Rounded rectangle 1 -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$positionImplies,1,1,1)"/>x) - 20);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('text','MPRule',$positionImplies,1,1,1)"/>y) - 60);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('width', <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width);
<!-- Determine height of 1st rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('text','MPRule',$positionImplies,1,1,1)"/>y) );
coordY=coordY+45;
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width);}
</script>
<xsl:apply-templates select="Equal"/> <!-- Conclusion of the rule -->
<!-- Rounded rectangle 2 + double arrow -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,2,1)"/>x) - 20);
<!-- Determine starting y coordinate for 2nd rounded rectangle using the starting position and height of the 1st rounded rectangle -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 32);
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,2,$countContentEqual)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,2,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,2,$countContentEqual)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 2nd rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y) - 50);
coordY=coordY+120;
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$positionImplies,1,1,1)"/>x) + 5;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/> = 'M ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r + '';
document.getElementById('<xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>').setAttribute('d', <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>);
coordY=coordY+25;
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width);}
</script>
</xsl:if>
<!-- Premise containing more than one Atom and/or Equal, conclusion of the rule is Atom -->
<xsl:if test="(count(current()/child::Atom))=1 and (count(current()/child::And))=1"> <!-- Multi-premise rule -->
<!-- Positions and counts of elements -->
<xsl:variable name="positionImplies" select="count(current()/preceding-sibling::*) + 1"/>
<xsl:variable name="countAtomsInAnd" select="count(current()/child::And/child::*)"/>
<xsl:variable name="countContentAtom" select="count(current()/child::Atom/child::*)"/>
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:2;fill:none</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/></xsl:attribute>
<xsl:attribute name="rx">10</xsl:attribute>
<xsl:attribute name="ry">10</xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:apply-templates select="And"/> <!-- Call template to draw the multi-premise of the rule -->
<!-- Rounded rectangle 1 -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$positionImplies,1,1,1)"/>x) - 20);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('text','MPRule',$positionImplies,1,1,1)"/>y) - 60);
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('width', <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width);
<!-- Determine height of 1st rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('text','MPRule',$positionImplies,1,1,1)"/>y) );
coordY=coordY+45;
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>width);}
</script>
<xsl:apply-templates select="Atom"/> <!-- Conclusion of the rule -->
<!-- Rounded rectangle 2 + double arrow -->
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,2,1)"/>x) - 20);
<!-- Determine starting y coordinate for 2nd rounded rectangle using the starting position and height of the 1st rounded rectangle -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 32);
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,2,$countContentAtom)"/>x) - parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,2,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','Rule',$positionImplies,2,$countContentAtom)"/>length) + 40);
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('y');
<!-- Determine height of 2nd rounded rectangle using the starting position and largest y coordinate -->
document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').setAttribute('height', parseFloat(coordY) - parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>y)-15);
coordY=coordY+120;
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('width');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>height = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('height');
var <xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>x = document.getElementById('<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>').getAttribute('x');
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$positionImplies,1,1,1)"/>x) + 5;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b = parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>y) + parseFloat(<xsl:value-of select="concat('round_rect','1','Rule',$positionImplies)"/>height) + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 13;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 10;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + 7;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r = <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b - 20;
var <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/> = 'M ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>a + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>b + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>c + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>d + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>e + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>f + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>g + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>h + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>i + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>j + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>k + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>l + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>m + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>n + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>o + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>p + ' L ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>q + ' ' + <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>r + '';
document.getElementById('<xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>').setAttribute('d', <xsl:value-of select="concat('double_arrow','Rule',$positionImplies)"/>);
coordY=coordY+25;
<!-- Finding the maximum width of the svg file -->
if (parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width) <![CDATA[>]]> maxCoordX)
{maxCoordX = parseFloat(<xsl:value-of select="concat('round_rect','2','Rule',$positionImplies)"/>width);}
</script>
</xsl:if>
</xsl:template> <!-- Implies -->
<!-- Draws the relations and equalities contained the in the premise of a multi-premise rule -->
<xsl:template match="And">
<!-- Multi-premise rule -->
<xsl:for-each select="./*"> <!-- For each child of And -->
<xsl:variable name="NaryMPAtomPosition" select="count(preceding-sibling::*) + 1"/>
<xsl:variable name="NaryMPImpliesPosition" select="count(parent::And/parent::Implies/preceding-sibling::*) + 1"/>
<xsl:variable name="positionBinaryMPEqual" select="count(preceding-sibling::*) + 1"/>
<xsl:variable name="positionBinaryMPImplies" select="count(parent::And/parent::Implies/preceding-sibling::*) + 1"/>
<!-- Count of descendants Expr used to determine spacing after predicate -->
<xsl:variable name="countDescExprMPImplies" select="count(descendant::Expr)"/>
<xsl:variable name="countChildExprMPImplies" select="count(child::Expr)"/>
<xsl:if test = "ancestor-or-self::Atom">
<xsl:for-each select="./*">
<!-- Position 1 is First term for Label Node form -->
<!-- Relation is the Label Node -->
<xsl:if test="(position()=1) and (ancestor-or-self::Rel)">
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:1;fill:none;</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:1;fill:none;</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:1;fill:none;</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:black;stroke-width:1;fill:none;</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">font-size:16px;font-family:courier,monospace;</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<!-- Step to the right -->
<xsl:if test="$NaryMPAtomPosition=1">
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', 50);
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', parseFloat(coordY));
<!-- 1st round rectangle width and height-->
var <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width = 0;
var <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>height = 10;
</script>
</xsl:if>
<!-- Start of a new row -->
<xsl:if test="$NaryMPAtomPosition!=1">
<script type="text/javascript">
document.getElementById("<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>").setAttribute("x", parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,($NaryMPAtomPosition*1)-1,1)"/>x));
document.getElementById("<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>").setAttribute("y", parseFloat(coordY));
</script>
</xsl:if>
<script type="text/javascript">
stringTemp = serializer.serializeToString(document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>'));
stringStart = stringTemp.indexOf(">");
stringEnd = stringTemp.lastIndexOf("<");
stringCompare = stringTemp.substring(stringStart+1, stringEnd);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = parseFloat(stringCompare.length* 9.609375);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('x');
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('y');
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x);
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 15;
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length);
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b;
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>e = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a - 15;
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>f = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b - 15;
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>g = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c + 15;
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>h = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d - 15;
var <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/> = 'M ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b + ' C ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>e + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>f + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>g + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>h + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d + '';
document.getElementById('<xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('d', <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>);
var <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>i = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c;
var <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d + 20;
var <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>k = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c + 15;
var <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>l = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d - 15;
var <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>m = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c + 15;
var <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>n = <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j + 15;
var <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/> = 'M ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d + ' C ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>k + ' ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>l + ' ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>m + ' ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>n + ' ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>i + ' ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j + '';
document.getElementById('<xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('d', <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>);
var <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>s = <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>i + 15;
var <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>t = <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j + 15;
var <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>u = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a - 15;
var <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>v = <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j + 15;
var <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/> = 'M ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>i + ' ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j + ' C ' + <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>s + ' ' + <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>t + ' ' + <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>u + ' ' + <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>v + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a + ' ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j + '';
document.getElementById('<xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('d', <xsl:value-of select="concat('curvePath3','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>);
var <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>w = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a - 15;
var <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b - 15;
var <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y = <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a - 15;
var <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>z = <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j + 15;
var <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/> = 'M ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b + ' C ' + <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>w + ' ' + <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x + ' ' + <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y + ' ' + <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>z + ' ' + <xsl:value-of select="concat('curvePath','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a + ' ' + <xsl:value-of select="concat('curvePath2','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>j + '';
document.getElementById('<xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('d', <xsl:value-of select="concat('curvePath4','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>);
</script>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="./*">
<!-- Next terms not including last term -->
<xsl:if test="(position() > 1) and (position()!=last())">
<xsl:if test="ancestor-or-self::Var">
<xsl:element name="polygon">
<xsl:attribute name="id"><xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill:url(#hatched); stroke-width:1;</xsl:attribute>
<xsl:attribute name="points"/>
</xsl:element>
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">font-size:16px;font-family:courier,monospace;</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>length) + 50);
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>y);
stringTemp = serializer.serializeToString(document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>'));
stringStart = stringTemp.indexOf(">");
stringEnd = stringTemp.lastIndexOf("<");
stringCompare = stringTemp.substring(stringStart+1, stringEnd);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = parseFloat(stringCompare.length* 9.609375);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('x');
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('y');
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) -25);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) -25);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 10) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 10) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 5);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>e = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>f = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>g = ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 10)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 5);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>h = ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 10)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/> = '' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>e + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>f + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>g + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>h + '';
document.getElementById('<xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('points', <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>);
</script>
</xsl:if>
<xsl:if test="(ancestor-or-self::Ind) or (ancestor-or-self::Data)">
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">font-size:16px;font-family:courier,monospace;</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>length) + 50);
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>y);
stringTemp = serializer.serializeToString(document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>'));
stringStart = stringTemp.indexOf(">");
stringEnd = stringTemp.lastIndexOf("<");
stringCompare = stringTemp.substring(stringStart+1, stringEnd);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = parseFloat(stringCompare.length* 9.609375);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('x');
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('y');
document.getElementById('<xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 20);
document.getElementById('<xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('height', 40);
document.getElementById('<xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 10);
document.getElementById('<xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 25);
</script>
</xsl:if>
<xsl:if test="self::Expr"> <!-- If node is Expr -->
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
</xsl:element>
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>length));
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('x');
coordX = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + 50;
coordY = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>y);
</script>
<xsl:variable name="countPositionsMP" select="count(preceding-sibling::*)+1"/>
<xsl:variable name="countFunctionsInMPAtom" select="count(preceding-sibling::Expr)+1"/>
<!-- If Expr is contained in Atom call template for nested function -->
<xsl:call-template name="NestedExpr">
<xsl:with-param name="constantType" select="concat('FunctionInMPMPRule',$NaryMPImpliesPosition)"/>
<xsl:with-param name="functionLevel" select="1"/>
<xsl:with-param name="countType" select="$NaryMPAtomPosition"/>
<xsl:with-param name="countFunctInLevel" select="$countFunctionsInMPAtom"/>
<xsl:with-param name="index" select="$countFunctionsInMPAtom"/>
</xsl:call-template>
<!-- Set length of function -->
<script type="text/javascript">
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = coordX - parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 50;
</script>
<!-- Count of descendants Expr used to determine spacing after predicate -->
<script type="text/javascript">
coordY = coordY + 90 + ((<xsl:value-of select="$countDescExprMPImplies"/> - <xsl:value-of select="$countChildExprMPImplies"/>)*75);
</script>
<xsl:if test="$countDescExprMPImplies > 0">
<script type="text/javascript">
coordY = coordY + 80;
</script>
</xsl:if>
</xsl:if> <!-- If node is Expr -->
</xsl:if> <!-- If node is greater than one and not last -->
<!-- Last term -->
<xsl:if test="position()=last()">
<xsl:if test="ancestor-or-self::Var">
<xsl:element name="polygon">
<xsl:attribute name="id"><xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill:url(#hatched); stroke-width:1;</xsl:attribute>
<xsl:attribute name="points"/>
</xsl:element>
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">font-size:16px;font-family:courier,monospace;</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/></xsl:attribute>
<xsl:attribute name="fill">none</xsl:attribute>
<xsl:attribute name="stroke">black</xsl:attribute>
<xsl:attribute name="stroke-width">1.5</xsl:attribute>
<xsl:attribute name="marker-end">url(#arrow)</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>length) + 50);
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>y);
coordY=coordY+110;
stringTemp = serializer.serializeToString(document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>'));
stringStart = stringTemp.indexOf(">");
stringEnd = stringTemp.lastIndexOf("<");
stringCompare = stringTemp.substring(stringStart+1, stringEnd);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = parseFloat(stringCompare.length* 9.609375);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('x');
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('y');
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) -25);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) -25);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 10) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 10) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 5);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>e = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>f = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>g = ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 10)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 5);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>h = ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 10)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/> = '' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>e + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>f + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>g + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>h + '';
document.getElementById('<xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('points', <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>);
<!-- 1st round rectangle width-->
if ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 40) <![CDATA[>]]> <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width)
{<xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 40;}
</script>
<!-- Path to begin at label node -->
<script type="text/javascript">
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-last()+1))"/>length) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-last()+1))"/>x);
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>b = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-last()+1))"/>y) - 20;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>c = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 13;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>d = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 20;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/> = 'M ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>a + ' ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>b + ' L ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>c + ' ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>d + '';
document.getElementById('<xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>').setAttribute('d', <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>);
</script>
</xsl:if>
<xsl:if test="(ancestor-or-self::Ind) or (ancestor-or-self::Data)">
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">font-size:16px;font-family:courier,monospace;</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/></xsl:attribute>
<xsl:attribute name="fill">none</xsl:attribute>
<xsl:attribute name="stroke">black</xsl:attribute>
<xsl:attribute name="stroke-width">1.5</xsl:attribute>
<xsl:attribute name="marker-end">url(#arrow)</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>length) + 50);
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>y);
coordY=coordY+100;
stringTemp = serializer.serializeToString(document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>'));
stringStart = stringTemp.indexOf(">");
stringEnd = stringTemp.lastIndexOf("<");
stringCompare = stringTemp.substring(stringStart+1, stringEnd);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = parseFloat(stringCompare.length* 9.609375);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('x');
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('y');
document.getElementById('<xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('width', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 20);
document.getElementById('<xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('height', 40);
document.getElementById('<xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 10);
document.getElementById('<xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 25);
<!-- 1st round rectangle width-->
if ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 40) <![CDATA[>]]> <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width)
{<xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 40;}
</script>
<!-- Path to begin at label node -->
<script type="text/javascript">
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-last()+1))"/>length) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-last()+1))"/>x);
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>b = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-last()+1))"/>y) - 20;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>c = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 18;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>d = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 20;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/> = 'M ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>a + ' ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>b + ' L ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>c + ' ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>d + '';
document.getElementById('<xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>').setAttribute('d', <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>);
</script>
</xsl:if>
<xsl:if test="self::Expr"> <!-- If node is Expr -->
<xsl:element name="path">
<xsl:attribute name="id"><xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/></xsl:attribute>
<xsl:attribute name="fill">none</xsl:attribute>
<xsl:attribute name="stroke">black</xsl:attribute>
<xsl:attribute name="stroke-width">1.5</xsl:attribute>
<xsl:attribute name="marker-end">url(#arrow)</xsl:attribute>
<xsl:attribute name="d"/>
</xsl:element>
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
</xsl:element>
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,(position()-1))"/>length));
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('x');
coordX = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + 50;
coordY = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>y);
</script>
<!-- path to join all elements -->
<script type="text/javascript">
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>length) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>x);
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>b = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>y) - 20;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>c = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + 35;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>d = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>y) - 20;
var <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/> = 'M ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>a + ' ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>b + ' L ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>c + ' ' + <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>d + '';
document.getElementById('<xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>').setAttribute('d', <xsl:value-of select="concat('path','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition)"/>);
</script>
<xsl:variable name="countPositionsMP" select="count(preceding-sibling::*)+1"/>
<xsl:variable name="countFunctionsInMPAtom" select="count(preceding-sibling::Expr)+1"/>
<!-- If Expr is contained in Atom call template for nested function -->
<xsl:call-template name="NestedExpr">
<xsl:with-param name="constantType" select="concat('FunctionInMPMPRule',$NaryMPImpliesPosition)"/>
<xsl:with-param name="functionLevel" select="1"/>
<xsl:with-param name="countType" select="$NaryMPAtomPosition"/>
<xsl:with-param name="countFunctInLevel" select="$countFunctionsInMPAtom"/>
<xsl:with-param name="index" select="$countFunctionsInMPAtom"/>
</xsl:call-template>
<!-- Set length of function -->
<script type="text/javascript">
coordY = coordY + 110;
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = coordX - parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 50;
</script>
<!-- Count of descendants Expr used to determine spacing after predicate -->
<script type="text/javascript">
coordY = coordY + 90 + ((<xsl:value-of select="$countDescExprMPImplies"/> - <xsl:value-of select="$countChildExprMPImplies"/>)*75);
</script>
<xsl:if test="$countDescExprMPImplies > 0">
<script type="text/javascript">
coordY = coordY + 80;
</script>
</xsl:if>
<!-- 1st round rectangle width-->
<script type="text/javascript">
if ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 40) <![CDATA[>]]> <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width)
{<xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 40;}
</script>
</xsl:if> <!-- If node is Expr -->
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- if Atom -->
<!-- Binary rule, multi-premise -->
<xsl:if test = "ancestor-or-self::Equal">
<xsl:for-each select="./*">
<!-- First term -->
<xsl:if test="position()=1">
<xsl:if test="ancestor-or-self::Var">
<xsl:element name="polygon">
<xsl:attribute name="id"><xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill:url(#hatched); stroke-width:1;</xsl:attribute>
<xsl:attribute name="points"/>
</xsl:element>
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">font-size:16px;font-family:courier,monospace;</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<!-- Step to the right -->
<xsl:if test="$NaryMPAtomPosition=1">
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', 50);
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', parseFloat(coordY));
<!-- 1st round rectangle width and height-->
var <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width = 0;
var <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>height = 10;
</script>
</xsl:if>
<!-- Start of a new row -->
<xsl:if test="$NaryMPAtomPosition!=1">
<script type="text/javascript">
document.getElementById("<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>").setAttribute("x", parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,($NaryMPAtomPosition*1)-1,1)"/>x));
document.getElementById("<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>").setAttribute("y", parseFloat(coordY));
</script>
</xsl:if>
<script type="text/javascript">
stringTemp = serializer.serializeToString(document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>'));
stringStart = stringTemp.indexOf(">");
stringEnd = stringTemp.lastIndexOf("<");
stringCompare = stringTemp.substring(stringStart+1, stringEnd);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = parseFloat(stringCompare.length* 9.609375);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('x');
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y = document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').getAttribute('y');
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) -25);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) -25);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 10) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length) + 10) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 5);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>e = (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>f = parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>g = ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 10)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) + 5);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>h = ((parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>x) - 10)) + ',' + (parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>y) - 15);
var <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/> = '' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>a + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>b + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>c + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>d + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>e + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>f + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>g + ' ' + <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>h + '';
document.getElementById('<xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('points', <xsl:value-of select="concat('polygon','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>);
</script>
</xsl:if>
<xsl:if test="(ancestor-or-self::Ind) or (ancestor-or-self::Data)">
<xsl:element name="rect">
<xsl:attribute name="id"><xsl:value-of select="concat('rect','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">stroke:#000000; fill: none; stroke-width:1;</xsl:attribute>
<xsl:attribute name="height"/>
<xsl:attribute name="width"/>
</xsl:element>
<xsl:element name="text">
<xsl:attribute name="id"><xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/></xsl:attribute>
<xsl:attribute name="style">font-size:16px;font-family:courier,monospace;</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<!-- Step to the right -->
<xsl:if test="$NaryMPAtomPosition=1">
<script type="text/javascript">
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('x', 50);
document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>').setAttribute('y', parseFloat(coordY));
<!-- 1st round rectangle width and height-->
var <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>width = 0;
var <xsl:value-of select="concat('round_rect','1','Rule',$NaryMPImpliesPosition)"/>height = 10;
</script>
</xsl:if>
<!-- Start of a new row -->
<xsl:if test="$NaryMPAtomPosition!=1">
<script type="text/javascript">
document.getElementById("<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>").setAttribute("x", parseFloat(<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,($NaryMPAtomPosition*1)-1,1)"/>x));
document.getElementById("<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,1)"/>").setAttribute("y", parseFloat(coordY));
</script>
</xsl:if>
<script type="text/javascript">
stringTemp = serializer.serializeToString(document.getElementById('<xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>'));
stringStart = stringTemp.indexOf(">");
stringEnd = stringTemp.lastIndexOf("<");
stringCompare = stringTemp.substring(stringStart+1, stringEnd);
var <xsl:value-of select="concat('text','MPRule',$NaryMPImpliesPosition,1,$NaryMPAtomPosition,position())"/>length = parseFloat(stringCompare.length* 9.609375);