Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
240 swalkenh 1
PK
577 swalkenh 2
 
3
 
240 swalkenh 4
Comment: you can set named regions on pictures
5
Transform-To-File: src/plugins/regionEditorPlugin/RegionEditorPluginTr
6
 ansform.xsl
7
Created-By: 1.4.0 (Sun Microsystems Inc.)
8
Description: ...(todo)
9
XMLEditor-Plugin-Name: RegionEditor
10
Class-Path: ImagePlugin.jar
11
Transform-Fro-File: src/plugins/regionEditorPlugin/RegionEditorPluginT
260 swalkenh 12
 ransformBack.xsl
240 swalkenh 13
Main-Class: src.plugins.regionEditorPlugin.RegionEditorPlugin
14
 
15
Name: src/plugins/regionEditorPlugin
16
Specification-Version: 0.4 (05/07/03)
17
Specification-Title: plugin for XMLEditor
18
Implementation-Version: 0.1 (05/07/03)
19
Implementation-Title: src.plugins.regionEditorPlugin
20
Implementation-Vendor: group5, software practice SS_2003, University B
21
 ielefeld, Germany
22
Specification-Vendor: group5, software practice SS_2003, University Bi
23
 elefeld, Germany
24
 
25
PK
577 swalkenh 26
 
521 swalkenh 27
 
28
 
29
pluginNameLjava/lang/String;
ConstantValueRegionEditor
30
guiLsrc/gui/GuiInterface;ourEventListenerLsrc/control/OurEventListener;labelLjavax/swing/JLabel;<init>()VCode
31
	javax/swing/JLabeldummy RegionEditorPlugin(Ljava/lang/String;)V
32
 
33
 
34
 
35
 
36
 
37
25java/lang/System7outLjava/io/PrintStream;9:	8;3I'm a new instance of the dummy RegionEditorPlugin!=java/io/PrintStream?printlnA
38
 
39
 
40
 
41
 
42
 
43
 
44
 
45
 
46
 
47
 
48
 
49
QREFGwx>*+µz±D
50
YZEFG{|+±DeEFG}~t$»€Y½dY+SY,SYS·ƒN*´z-¹‰±Dij#kE*$FG$Š‹$Œ‹ŽPK
577 swalkenh 51
 
52
 
53
 
54
 
55
 
56
 
57
 
58
 
59
 
521 swalkenh 60
 *
61
 * Last modification: $Date: 2003/07/16 19:42:05 $
62
 * $Id: RegionEditorPlugin.java,v 1.13 2003/07/16 19:42:05 smcsporr Exp $
63
 */
64
577 swalkenh 65
package src.plugins.regionEditorPlugin;
521 swalkenh 66
577 swalkenh 67
import java.awt.BorderLayout;
68
521 swalkenh 69
import javax.swing.JLabel;
70
 
71
72
 
73
import org.w3c.dom.Document;
74
 
75
76
import src.control.OurEvent;
77
 
78
79
import src.gui.*;
80
import src.plugins.PluginInterface;
81
 
82
/**
83
 *  Dummy plugin used for testing
84
 
85
// TODO JavaDoc comments
86
public class RegionEditorPlugin extends JPanel
87
 
88
	
89
	/* Name of the plugin, used in method <code>firePluginChangedElement</code> */
90
	final private String pluginName = "RegionEditor";
91
	
92
	private GuiInterface gui;
93
	private OurEventListener ourEventListener;
94
 
577 swalkenh 95
521 swalkenh 96
	// TODO JavaDoc-comments
97
 
98
		setLayout(new BorderLayout());
99
		add(label, BorderLayout.CENTER);
100
		setVisible(false);
101
 
102
		System.out.println("I'm a new instance of the dummy RegionEditorPlugin!");
103
	}
104
	
105
106
	/* (non-Javadoc)
107
 
108
	 */
109
	public void init(GuiInterface gui) {
110
 
111
 
112
		System.out.println("dummy RegionEditorPlugin initialized");
113
	}
114
115
116
	/* (non-Javadoc)
117
 
118
	 */
119
	public void start(Node node, Document environment) {
120
 
121
 
122
		//added 14.07.03 Sascha W. -> fixed problem of not visible plugins
123
		// (deleted this line in method "init"!)
124
		gui.setPluginPanel(this);
125
		setVisible(true);
126
	}
127
 
128
129
	/* (non-Javadoc)
130
	 * @see src.gui.PluginInterface#stop()
131
	 */
132
	public void stop() {
133
 
134
 
135
136
137
	/* (non-Javadoc)
138
	 * @see src.gui.PluginInterface#setOurEventListener(src.control.OurEventListener)
139
	 */
140
	public void setOurEventListener(OurEventListener newListener) {
141
 
142
 
143
144
145
	/**
146
	 * Forces the text editor plugin to return the actual status as a node, 'cause
147
	 * not well-formed parts have to be capsuled into a processing instruction.
148
	 * 
149
 
150
 
151
	public void forceStatusReport() {
152
		//firePluginChangedElement(originalElement, originalElement);
577 swalkenh 153
	}
521 swalkenh 154
	
155
	// TODO JavaDoc-comments
156
	private void firePluginChangedElement(Element oldNode, Element changedElement) {
157
		OurEvent e = new OurEvent(new Object[] {oldNode, changedElement, pluginName});
158
		ourEventListener.firedOurEvent(e);
159
	}
160
 
161
º‰ñ.׿ä5ä5>src/plugins/regionEditorPlugin/RegionEditorPluginTransform.xsl<!-- to-direction for RegionEditor
162
     status: not tested, should be not so long
163
     updated to given schema from 15/07/2003 
164
     Last Revision: 17/07/2003 by Sascha Walkenhorst -->
165
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
240 swalkenh 166
<xsl:output method="xml" indent="yes" />
577 swalkenh 167
 
168
169
<xsl:template match="/">
170
	<xsl:apply-templates />
545 swalkenh 171
</xsl:template>
172
173
 
174
 
175
	<xsl:element name="REGIONSET">
176
177
		<!-- work on attributes -->
178
 
179
 
577 swalkenh 180
			<xsl:value-of select="@image" />
545 swalkenh 181
		</xsl:attribute>
182
 
183
		<xsl:for-each select="attribute::*">
577 swalkenh 184
			<xsl:if test = "not(name(.) = ('image'))">
545 swalkenh 185
				<xsl:attribute name="{name(.)}">
577 swalkenh 186
					<xsl:value-of select="self::node()" />
545 swalkenh 187
				</xsl:attribute>
577 swalkenh 188
			</xsl:if>
545 swalkenh 189
		</xsl:for-each>
577 swalkenh 190
545 swalkenh 191
		<!-- work on childs -->
192
		<!-- get information of used rectangle out of child 'RECTANGLE' -->
193
		<xsl:for-each select="RECTANGLE">
194
			<xsl:element name="RECTANGLE">
195
				<!-- get coordinates -->
196
 
197
					<xsl:element name="COORDS">
577 swalkenh 198
						<xsl:attribute name="x">
199
							<xsl:value-of select="@x" />
200
						</xsl:attribute>
201
						<xsl:attribute name="y">
202
							<xsl:value-of select="@y" />
203
						</xsl:attribute>
204
						<xsl:attribute name="w">
205
							<xsl:value-of select="@w" />
545 swalkenh 206
						</xsl:attribute>
577 swalkenh 207
						<xsl:attribute name="h">
208
							<xsl:value-of select="@h" />
209
						</xsl:attribute>
210
						<xsl:for-each select="attribute::*">
211
							<xsl:if test = "not(name(.) = 'x')">
212
							<xsl:if test = "not(name(.) = 'y')">
213
							<xsl:if test = "not(name(.) = 'w')">
214
							<xsl:if test = "not(name(.) = 'h')">
215
								<xsl:attribute name="{name(.)}">
216
									<xsl:value-of select="self::node()" />
217
								</xsl:attribute>
218
							</xsl:if></xsl:if></xsl:if></xsl:if>
219
						</xsl:for-each>
220
						<xsl:for-each select="node()">
221
							<xsl:copy-of select="self::node()" />
222
						</xsl:for-each>
223
						<!-- Insert an attribut which saves the original name of node,
224
						     cause all nodes which contain data are transformed to a
225
						     "COORDS" node. This extra information is used in back-
226
						     transformation to restore the original name. -->
227
						<xsl:attribute name="XMLEditorSavedNameOfNode">
228
							<xsl:value-of select="name(.)" />
229
						</xsl:attribute>
230
					</xsl:element>
231
				</xsl:for-each>
232
				<xsl:for-each select="COORD_DATA">
233
					<xsl:element name="COORDS">
234
						<xsl:attribute name="x">
235
							<xsl:value-of select="@x_pos" />
236
						</xsl:attribute>
545 swalkenh 237
						<xsl:attribute name="y">
577 swalkenh 238
							<xsl:value-of select="@y_pos" />
239
						</xsl:attribute>
240
						<xsl:attribute name="w">
241
							<xsl:value-of select="@width" />
242
						</xsl:attribute>
243
						<xsl:attribute name="h">
244
							<xsl:value-of select="@height" />
245
						</xsl:attribute>
246
						<xsl:for-each select="attribute::*">
247
							<xsl:if test = "not(name(.) = 'x_pos')">
248
							<xsl:if test = "not(name(.) = 'y_pos')">
249
							<xsl:if test = "not(name(.) = 'width')">
250
							<xsl:if test = "not(name(.) = 'height')">
251
								<xsl:attribute name="{name(.)}">
252
									<xsl:value-of select="self::node()" />
253
								</xsl:attribute>
254
							</xsl:if></xsl:if></xsl:if></xsl:if>
255
						</xsl:for-each>
256
						<xsl:for-each select="node()">
257
							<xsl:copy-of select="self::node()" />
258
						</xsl:for-each>
259
						<!-- Insert an attribut which saves the original name of node,
260
						     cause all nodes which contain data are transformed to a
261
						     "COORDS" node. This extra information is used in back-
262
						     transformation to restore the original name. -->
263
						<xsl:attribute name="XMLEditorSavedNameOfNode">
264
							<xsl:value-of select="name(.)" />
265
						</xsl:attribute>
266
					</xsl:element>
267
				</xsl:for-each>
268
				<!-- copy all other childs -->
269
				<xsl:for-each select="node()">
270
					<xsl:if test = "not(name(.) = 'COORDS')">
271
					<xsl:if test = "not(name(.) = 'COORD_DATA')">
272
						<xsl:copy-of select="self::node()" />
273
					</xsl:if></xsl:if>
274
				</xsl:for-each>
545 swalkenh 275
			</xsl:element>
577 swalkenh 276
		</xsl:for-each>
277
278
		<!-- get information of used ellipse out of child 'ELLIPSE' -->
279
		<xsl:for-each select="ELLIPSE">
545 swalkenh 280
			<xsl:element name="ELLIPSE">
281
				<!-- get coordinates -->
282
				<xsl:for-each select="COORDS">
577 swalkenh 283
 
284
						<xsl:attribute name="x">
285
							<xsl:value-of select="@x" />
286
						</xsl:attribute>
287
						<xsl:attribute name="y">
288
							<xsl:value-of select="@y" />
289
						</xsl:attribute>
290
						<xsl:attribute name="w">
291
							<xsl:value-of select="@w" />
292
						</xsl:attribute>
293
						<xsl:attribute name="h">
294
							<xsl:value-of select="@h" />
295
						</xsl:attribute>
296
						<xsl:attribute name="angle">
297
							<xsl:value-of select="@angle" />
298
						</xsl:attribute>
299
						<xsl:for-each select="attribute::*">
300
							<xsl:if test = "not(name(.) = 'x')">
301
							<xsl:if test = "not(name(.) = 'y')">
302
							<xsl:if test = "not(name(.) = 'w')">
303
							<xsl:if test = "not(name(.) = 'h')">
304
							<xsl:if test = "not(name(.) = 'angle')">
305
								<xsl:attribute name="{name(.)}">
306
									<xsl:value-of select="self::node()" />
307
								</xsl:attribute>
308
							</xsl:if></xsl:if></xsl:if></xsl:if></xsl:if>
309
						</xsl:for-each>
310
						<xsl:for-each select="node()">
311
							<xsl:copy-of select="self::node()" />
312
						</xsl:for-each>
313
					</xsl:element>
314
				</xsl:for-each>
315
				<!-- copy all other childs -->
316
				<xsl:for-each select="node()">
317
					<xsl:if test = "not(name(.) = 'COORDS')">
318
						<xsl:copy-of select="self::node()" />
319
					</xsl:if>
320
				</xsl:for-each>
321
			</xsl:element>
322
		</xsl:for-each>
323
324
		<!-- get information of used polyline out of child 'POLYLINE' -->
325
		<xsl:for-each select="POLYLINE">
326
			<xsl:element name="POLYLINE">
327
				<!-- get coordinates -->
328
				<xsl:for-each select="COORDS">
329
 
330
						<xsl:attribute name="x">
331
							<xsl:value-of select="@x" />
332
						</xsl:attribute>
333
						<xsl:attribute name="y">
334
							<xsl:value-of select="@y" />
335
						</xsl:attribute>
336
						<xsl:for-each select="attribute::*">
337
							<xsl:if test = "not(name(.) = 'x')">
338
							<xsl:if test = "not(name(.) = 'y')">
339
								<xsl:attribute name="{name(.)}">
340
									<xsl:value-of select="self::node()" />
341
								</xsl:attribute>
342
							</xsl:if></xsl:if>
343
						</xsl:for-each>
344
						<xsl:for-each select="node()">
345
							<xsl:copy-of select="self::node()" />
346
						</xsl:for-each>
347
					</xsl:element>
348
				</xsl:for-each>
349
				<!-- copy all other childs -->
350
				<xsl:for-each select="node()">
351
					<xsl:if test = "not(name(.) = 'COORDS')">
352
						<xsl:copy-of select="self::node()" />
353
					</xsl:if>
354
				</xsl:for-each>
355
			</xsl:element>
356
		</xsl:for-each>
357
358
		<!-- copy all other childs -->
359
		<xsl:for-each select="node()">
360
			<xsl:if test = "not(name(.) = 'RECTANGLE')">
361
			<xsl:if test = "not(name(.) = 'ELLIPSE')">
362
			<xsl:if test = "not(name(.) = 'POLYLINE')">
363
 
364
			</xsl:if></xsl:if></xsl:if>
545 swalkenh 365
		</xsl:for-each>
577 swalkenh 366
367
	</xsl:element>
368
</xsl:template>
545 swalkenh 369
577 swalkenh 370
<xsl:template match="REGIONSET"><!-- element-plugin association -->
545 swalkenh 371
	<xsl:element name="REGIONSET">
372
 
373
		<!-- work on attributes -->
374
		<!-- get information of used image out of attribute 'image' -->
375
 
376
			<xsl:value-of select="@image" />
577 swalkenh 377
		</xsl:attribute>
378
 
379
		<xsl:for-each select="attribute::*">
380
			<xsl:if test = "not(name(.) = ('image'))">
381
				<xsl:attribute name="{name(.)}">
382
					<xsl:value-of select="self::node()" />
383
				</xsl:attribute>
384
			</xsl:if>
385
		</xsl:for-each>
386
387
		<!-- work on childs -->
388
		<!-- get information of used rectangle out of child 'RECTANGLE' -->
389
		<xsl:for-each select="RECTANGLE">
390
			<xsl:element name="RECTANGLE">
391
				<!-- get coordinates -->
392
 
393
					<xsl:element name="COORDS">
394
						<xsl:attribute name="x">
395
							<xsl:value-of select="@x" />
396
						</xsl:attribute>
397
						<xsl:attribute name="y">
398
							<xsl:value-of select="@y" />
399
						</xsl:attribute>
400
						<xsl:attribute name="w">
401
							<xsl:value-of select="@w" />
402
						</xsl:attribute>
403
						<xsl:attribute name="h">
404
							<xsl:value-of select="@h" />
405
						</xsl:attribute>
406
						<xsl:for-each select="attribute::*">
407
							<xsl:if test = "not(name(.) = 'x')">
408
							<xsl:if test = "not(name(.) = 'y')">
409
							<xsl:if test = "not(name(.) = 'w')">
410
							<xsl:if test = "not(name(.) = 'h')">
411
								<xsl:attribute name="{name(.)}">
412
									<xsl:value-of select="self::node()" />
413
								</xsl:attribute>
414
							</xsl:if></xsl:if></xsl:if></xsl:if>
415
						</xsl:for-each>
416
						<xsl:for-each select="node()">
417
							<xsl:copy-of select="self::node()" />
418
						</xsl:for-each>
419
						<!-- Insert an attribut which saves the original name of node,
420
						     cause all nodes which contain data are transformed to a
421
						     "COORDS" node. This extra information is used in back-
422
						     transformation to restore the original name. -->
423
						<xsl:attribute name="XMLEditorSavedNameOfNode">
424
							<xsl:value-of select="name(.)" />
425
						</xsl:attribute>
426
					</xsl:element>
427
				</xsl:for-each>
428
				<xsl:for-each select="COORD_DATA">
429
					<xsl:element name="COORDS">
430
						<xsl:attribute name="x">
431
							<xsl:value-of select="@x_pos" />
432
						</xsl:attribute>
433
						<xsl:attribute name="y">
434
							<xsl:value-of select="@y_pos" />
435
						</xsl:attribute>
436
						<xsl:attribute name="w">
437
							<xsl:value-of select="@width" />
438
						</xsl:attribute>
439
						<xsl:attribute name="h">
440
							<xsl:value-of select="@height" />
441
						</xsl:attribute>
442
						<xsl:for-each select="attribute::*">
443
							<xsl:if test = "not(name(.) = 'x_pos')">
444
							<xsl:if test = "not(name(.) = 'y_pos')">
445
							<xsl:if test = "not(name(.) = 'width')">
446
							<xsl:if test = "not(name(.) = 'height')">
447
								<xsl:attribute name="{name(.)}">
448
									<xsl:value-of select="self::node()" />
449
								</xsl:attribute>
450
							</xsl:if></xsl:if></xsl:if></xsl:if>
451
						</xsl:for-each>
452
						<xsl:for-each select="node()">
453
							<xsl:copy-of select="self::node()" />
454
						</xsl:for-each>
455
						<!-- Insert an attribut which saves the original name of node,
456
						     cause all nodes which contain data are transformed to a
457
						     "COORDS" node. This extra information is used in back-
458
						     transformation to restore the original name. -->
459
						<xsl:attribute name="XMLEditorSavedNameOfNode">
460
							<xsl:value-of select="name(.)" />
461
						</xsl:attribute>
462
					</xsl:element>
463
				</xsl:for-each>
464
				<!-- copy all other childs -->
465
				<xsl:for-each select="node()">
466
					<xsl:if test = "not(name(.) = 'COORDS')">
467
					<xsl:if test = "not(name(.) = 'COORD_DATA')">
468
						<xsl:copy-of select="self::node()" />
469
					</xsl:if></xsl:if>
470
				</xsl:for-each>
471
			</xsl:element>
472
		</xsl:for-each>
473
474
		<!-- get information of used ellipse out of child 'ELLIPSE' -->
475
		<xsl:for-each select="ELLIPSE">
476
			<xsl:element name="ELLIPSE">
477
				<!-- get coordinates -->
478
				<xsl:for-each select="COORDS">
479
 
480
						<xsl:attribute name="x">
481
							<xsl:value-of select="@x" />
482
						</xsl:attribute>
483
						<xsl:attribute name="y">
484
							<xsl:value-of select="@y" />
485
						</xsl:attribute>
486
						<xsl:attribute name="w">
487
							<xsl:value-of select="@w" />
488
						</xsl:attribute>
489
						<xsl:attribute name="h">
490
							<xsl:value-of select="@h" />
491
						</xsl:attribute>
492
						<xsl:attribute name="angle">
493
							<xsl:value-of select="@angle" />
494
						</xsl:attribute>
495
						<xsl:for-each select="attribute::*">
496
							<xsl:if test = "not(name(.) = 'x')">
497
							<xsl:if test = "not(name(.) = 'y')">
498
							<xsl:if test = "not(name(.) = 'w')">
499
							<xsl:if test = "not(name(.) = 'h')">
500
							<xsl:if test = "not(name(.) = 'angle')">
501
								<xsl:attribute name="{name(.)}">
502
									<xsl:value-of select="self::node()" />
503
								</xsl:attribute>
504
							</xsl:if></xsl:if></xsl:if></xsl:if></xsl:if>
505
						</xsl:for-each>
506
						<xsl:for-each select="node()">
507
							<xsl:copy-of select="self::node()" />
508
						</xsl:for-each>
509
					</xsl:element>
510
				</xsl:for-each>
511
				<!-- copy all other childs -->
512
				<xsl:for-each select="node()">
513
					<xsl:if test = "not(name(.) = 'COORDS')">
514
						<xsl:copy-of select="self::node()" />
515
					</xsl:if>
516
				</xsl:for-each>
517
			</xsl:element>
518
		</xsl:for-each>
519
520
		<!-- get information of used polyline out of child 'POLYLINE' -->
521
		<xsl:for-each select="POLYLINE">
522
			<xsl:element name="POLYLINE">
523
				<!-- get coordinates -->
524
				<xsl:for-each select="COORDS">
525
 
526
						<xsl:attribute name="x">
527
							<xsl:value-of select="@x" />
528
						</xsl:attribute>
529
						<xsl:attribute name="y">
530
							<xsl:value-of select="@y" />
531
						</xsl:attribute>
532
						<xsl:for-each select="attribute::*">
533
							<xsl:if test = "not(name(.) = 'x')">
534
							<xsl:if test = "not(name(.) = 'y')">
535
								<xsl:attribute name="{name(.)}">
536
									<xsl:value-of select="self::node()" />
537
								</xsl:attribute>
538
							</xsl:if></xsl:if>
539
						</xsl:for-each>
540
						<xsl:for-each select="node()">
541
							<xsl:copy-of select="self::node()" />
542
						</xsl:for-each>
543
					</xsl:element>
544
				</xsl:for-each>
545
				<!-- copy all other childs -->
546
				<xsl:for-each select="node()">
547
					<xsl:if test = "not(name(.) = 'COORDS')">
548
						<xsl:copy-of select="self::node()" />
549
					</xsl:if>
550
				</xsl:for-each>
551
			</xsl:element>
552
		</xsl:for-each>
553
554
		<!-- copy all other childs -->
555
		<xsl:for-each select="node()">
556
			<xsl:if test = "not(name(.) = 'RECTANGLE')">
557
			<xsl:if test = "not(name(.) = 'ELLIPSE')">
558
			<xsl:if test = "not(name(.) = 'POLYLINE')">
559
 
560
			</xsl:if></xsl:if></xsl:if>
561
		</xsl:for-each>
562
563
	</xsl:element>
564
</xsl:template>
565
566
567
</xsl:stylesheet>PK
568
 
569
     status: not tested
545 swalkenh 570
     updated to given schema from 15/07/2003 
571
 
572
 
240 swalkenh 573
<xsl:output method="xml" indent="yes" />
577 swalkenh 574
 
575
576
<xsl:template match="/">
577
	<xsl:apply-templates />
545 swalkenh 578
</xsl:template>
579
580
 
581
 
582
	<xsl:element name="REGIONS">
583
584
		<!-- work on attributes -->
585
 
586
 
577 swalkenh 587
			<xsl:value-of select="@image" />
588
		</xsl:attribute>
545 swalkenh 589
 
590
		<xsl:for-each select="attribute::*">
577 swalkenh 591
			<xsl:if test = "not(name(.) = ('image'))">
592
				<xsl:attribute name="{name(.)}">
545 swalkenh 593
					<xsl:value-of select="self::node()" />
594
				</xsl:attribute>
577 swalkenh 595
			</xsl:if>
545 swalkenh 596
		</xsl:for-each>
597
598
		<!-- work on childs -->
599
		<!-- get information of used rectangle out of child 'RECTANGLE' -->
600
		<xsl:for-each select="RECTANGLE">
601
			<xsl:element name="RECTANGLE">
602
				<!-- get coordinates -->
603
 
604
					<xsl:element name="COORDS">
577 swalkenh 605
						<xsl:attribute name="x">
606
							<xsl:value-of select="@x" />
607
						</xsl:attribute>
608
						<xsl:attribute name="y">
609
							<xsl:value-of select="@y" />
610
						</xsl:attribute>
611
						<xsl:attribute name="w">
612
							<xsl:value-of select="@w" />
545 swalkenh 613
						</xsl:attribute>
577 swalkenh 614
						<xsl:attribute name="h">
615
							<xsl:value-of select="@h" />
616
						</xsl:attribute>
617
						<xsl:for-each select="attribute::*">
618
							<xsl:if test = "not(name(.) = 'x')">
619
							<xsl:if test = "not(name(.) = 'y')">
620
							<xsl:if test = "not(name(.) = 'w')">
621
							<xsl:if test = "not(name(.) = 'h')">
622
								<xsl:attribute name="{name(.)}">
623
									<xsl:value-of select="self::node()" />
624
								</xsl:attribute>
625
							</xsl:if></xsl:if></xsl:if></xsl:if>
626
						</xsl:for-each>
627
						<xsl:for-each select="node()">
628
							<xsl:copy-of select="self::node()" />
629
						</xsl:for-each>
630
						<!-- Insert an attribut which saves the original name of node,
631
						     cause all nodes which contain data are transformed to a
632
						     "COORDS" node. This extra information is used in back-
633
						     transformation to restore the original name. -->
634
						<xsl:attribute name="XMLEditorSavedNameOfNode">
635
							<xsl:value-of select="name(.)" />
636
						</xsl:attribute>
637
					</xsl:element>
638
				</xsl:for-each>
639
				<xsl:for-each select="COORD_DATA">
640
					<xsl:element name="COORDS">
641
						<xsl:attribute name="x">
642
							<xsl:value-of select="@x_pos" />
643
						</xsl:attribute>
545 swalkenh 644
						<xsl:attribute name="y">
577 swalkenh 645
							<xsl:value-of select="@y_pos" />
646
						</xsl:attribute>
647
						<xsl:attribute name="w">
648
							<xsl:value-of select="@width" />
649
						</xsl:attribute>
650
						<xsl:attribute name="h">
651
							<xsl:value-of select="@height" />
652
						</xsl:attribute>
653
						<xsl:for-each select="attribute::*">
654
							<xsl:if test = "not(name(.) = 'x_pos')">
655
							<xsl:if test = "not(name(.) = 'y_pos')">
656
							<xsl:if test = "not(name(.) = 'width')">
657
							<xsl:if test = "not(name(.) = 'height')">
658
								<xsl:attribute name="{name(.)}">
659
									<xsl:value-of select="self::node()" />
660
								</xsl:attribute>
661
							</xsl:if></xsl:if></xsl:if></xsl:if>
662
						</xsl:for-each>
663
						<xsl:for-each select="node()">
664
							<xsl:copy-of select="self::node()" />
665
						</xsl:for-each>
666
						<!-- Insert an attribut which saves the original name of node,
667
						     cause all nodes which contain data are transformed to a
668
						     "COORDS" node. This extra information is used in back-
669
						     transformation to restore the original name. -->
670
						<xsl:attribute name="XMLEditorSavedNameOfNode">
671
							<xsl:value-of select="name(.)" />
672
						</xsl:attribute>
673
					</xsl:element>
674
				</xsl:for-each>
675
				<!-- copy all other childs -->
676
				<xsl:for-each select="node()">
677
					<xsl:if test = "not(name(.) = 'COORDS')">
678
					<xsl:if test = "not(name(.) = 'COORD_DATA')">
679
						<xsl:copy-of select="self::node()" />
680
					</xsl:if></xsl:if>
681
				</xsl:for-each>
545 swalkenh 682
			</xsl:element>
577 swalkenh 683
		</xsl:for-each>
684
685
		<!-- get information of used ellipse out of child 'ELLIPSE' -->
686
		<xsl:for-each select="ELLIPSE">
545 swalkenh 687
			<xsl:element name="ELLIPSE">
688
				<!-- get coordinates -->
689
				<xsl:for-each select="COORDS">
577 swalkenh 690
 
691
						<xsl:attribute name="x">
692
							<xsl:value-of select="@x" />
693
						</xsl:attribute>
694
						<xsl:attribute name="y">
695
							<xsl:value-of select="@y" />
696
						</xsl:attribute>
697
						<xsl:attribute name="w">
698
							<xsl:value-of select="@w" />
699
						</xsl:attribute>
700
						<xsl:attribute name="h">
701
							<xsl:value-of select="@h" />
702
						</xsl:attribute>
703
						<xsl:attribute name="angle">
704
							<xsl:value-of select="@angle" />
705
						</xsl:attribute>
706
						<xsl:for-each select="attribute::*">
707
							<xsl:if test = "not(name(.) = 'x')">
708
							<xsl:if test = "not(name(.) = 'y')">
709
							<xsl:if test = "not(name(.) = 'w')">
710
							<xsl:if test = "not(name(.) = 'h')">
711
							<xsl:if test = "not(name(.) = 'angle')">
712
								<xsl:attribute name="{name(.)}">
713
									<xsl:value-of select="self::node()" />
714
								</xsl:attribute>
715
							</xsl:if></xsl:if></xsl:if></xsl:if></xsl:if>
716
						</xsl:for-each>
717
						<xsl:for-each select="node()">
718
							<xsl:copy-of select="self::node()" />
719
						</xsl:for-each>
720
					</xsl:element>
721
				</xsl:for-each>
722
				<!-- copy all other childs -->
723
				<xsl:for-each select="node()">
724
					<xsl:if test = "not(name(.) = 'COORDS')">
725
						<xsl:copy-of select="self::node()" />
726
					</xsl:if>
727
				</xsl:for-each>
728
			</xsl:element>
729
		</xsl:for-each>
730
731
		<!-- get information of used polyline out of child 'POLYLINE' -->
732
		<xsl:for-each select="POLYLINE">
733
			<xsl:element name="POLYLINE">
734
				<!-- get coordinates -->
735
				<xsl:for-each select="COORDS">
736
 
737
						<xsl:attribute name="x">
738
							<xsl:value-of select="@x" />
739
						</xsl:attribute>
740
						<xsl:attribute name="y">
741
							<xsl:value-of select="@y" />
742
						</xsl:attribute>
743
						<xsl:for-each select="attribute::*">
744
							<xsl:if test = "not(name(.) = 'x')">
745
							<xsl:if test = "not(name(.) = 'y')">
746
								<xsl:attribute name="{name(.)}">
747
									<xsl:value-of select="self::node()" />
748
								</xsl:attribute>
749
							</xsl:if></xsl:if>
750
						</xsl:for-each>
751
						<xsl:for-each select="node()">
752
							<xsl:copy-of select="self::node()" />
753
						</xsl:for-each>
754
					</xsl:element>
755
				</xsl:for-each>
756
				<!-- copy all other childs -->
757
				<xsl:for-each select="node()">
758
					<xsl:if test = "not(name(.) = 'COORDS')">
759
						<xsl:copy-of select="self::node()" />
760
					</xsl:if>
761
				</xsl:for-each>
762
			</xsl:element>
763
		</xsl:for-each>
764
765
		<!-- copy all other childs -->
766
		<xsl:for-each select="node()">
767
			<xsl:if test = "not(name(.) = 'RECTANGLE')">
768
			<xsl:if test = "not(name(.) = 'ELLIPSE')">
769
			<xsl:if test = "not(name(.) = 'POLYLINE')">
770
 
771
			</xsl:if></xsl:if></xsl:if>
545 swalkenh 772
		</xsl:for-each>
577 swalkenh 773
774
	</xsl:element>
775
</xsl:template>
545 swalkenh 776
577 swalkenh 777
<xsl:template match="REGIONSET"><!-- element-plugin association -->
545 swalkenh 778
	<xsl:element name="REGIONSET">
779
 
780
		<!-- work on attributes -->
781
		<!-- get information of used image out of attribute 'image' -->
782
 
577 swalkenh 783
			<xsl:value-of select="@image" />
784
		</xsl:attribute>
785
 
786
		<xsl:for-each select="attribute::*">
787
			<xsl:if test = "not(name(.) = ('image'))">
788
				<xsl:attribute name="{name(.)}">
789
					<xsl:value-of select="self::node()" />
790
				</xsl:attribute>
791
			</xsl:if>
792
		</xsl:for-each>
793
794
		<!-- work on childs -->
795
		<!-- get information of used rectangle out of child 'RECTANGLE' -->
796
		<xsl:for-each select="RECTANGLE">
797
			<xsl:element name="RECTANGLE">
798
				<!-- get coordinates -->
799
 
800
					<xsl:element name="COORDS">
801
						<xsl:attribute name="x">
802
							<xsl:value-of select="@x" />
803
						</xsl:attribute>
804
						<xsl:attribute name="y">
805
							<xsl:value-of select="@y" />
806
						</xsl:attribute>
807
						<xsl:attribute name="w">
808
							<xsl:value-of select="@w" />
809
						</xsl:attribute>
810
						<xsl:attribute name="h">
811
							<xsl:value-of select="@h" />
812
						</xsl:attribute>
813
						<xsl:for-each select="attribute::*">
814
							<xsl:if test = "not(name(.) = 'x')">
815
							<xsl:if test = "not(name(.) = 'y')">
816
							<xsl:if test = "not(name(.) = 'w')">
817
							<xsl:if test = "not(name(.) = 'h')">
818
								<xsl:attribute name="{name(.)}">
819
									<xsl:value-of select="self::node()" />
820
								</xsl:attribute>
821
							</xsl:if></xsl:if></xsl:if></xsl:if>
822
						</xsl:for-each>
823
						<xsl:for-each select="node()">
824
							<xsl:copy-of select="self::node()" />
825
						</xsl:for-each>
826
						<!-- Insert an attribut which saves the original name of node,
827
						     cause all nodes which contain data are transformed to a
828
						     "COORDS" node. This extra information is used in back-
829
						     transformation to restore the original name. -->
830
						<xsl:attribute name="XMLEditorSavedNameOfNode">
831
							<xsl:value-of select="name(.)" />
832
						</xsl:attribute>
833
					</xsl:element>
834
				</xsl:for-each>
835
				<xsl:for-each select="COORD_DATA">
836
					<xsl:element name="COORDS">
837
						<xsl:attribute name="x">
838
							<xsl:value-of select="@x_pos" />
839
						</xsl:attribute>
840
						<xsl:attribute name="y">
841
							<xsl:value-of select="@y_pos" />
842
						</xsl:attribute>
843
						<xsl:attribute name="w">
844
							<xsl:value-of select="@width" />
845
						</xsl:attribute>
846
						<xsl:attribute name="h">
847
							<xsl:value-of select="@height" />
848
						</xsl:attribute>
849
						<xsl:for-each select="attribute::*">
850
							<xsl:if test = "not(name(.) = 'x_pos')">
851
							<xsl:if test = "not(name(.) = 'y_pos')">
852
							<xsl:if test = "not(name(.) = 'width')">
853
							<xsl:if test = "not(name(.) = 'height')">
854
								<xsl:attribute name="{name(.)}">
855
									<xsl:value-of select="self::node()" />
856
								</xsl:attribute>
857
							</xsl:if></xsl:if></xsl:if></xsl:if>
858
						</xsl:for-each>
859
						<xsl:for-each select="node()">
860
							<xsl:copy-of select="self::node()" />
861
						</xsl:for-each>
862
						<!-- Insert an attribut which saves the original name of node,
863
						     cause all nodes which contain data are transformed to a
864
						     "COORDS" node. This extra information is used in back-
865
						     transformation to restore the original name. -->
866
						<xsl:attribute name="XMLEditorSavedNameOfNode">
867
							<xsl:value-of select="name(.)" />
868
						</xsl:attribute>
869
					</xsl:element>
870
				</xsl:for-each>
871
				<!-- copy all other childs -->
872
				<xsl:for-each select="node()">
873
					<xsl:if test = "not(name(.) = 'COORDS')">
874
					<xsl:if test = "not(name(.) = 'COORD_DATA')">
875
						<xsl:copy-of select="self::node()" />
876
					</xsl:if></xsl:if>
877
				</xsl:for-each>
878
			</xsl:element>
879
		</xsl:for-each>
880
881
		<!-- get information of used ellipse out of child 'ELLIPSE' -->
882
		<xsl:for-each select="ELLIPSE">
883
			<xsl:element name="ELLIPSE">
884
				<!-- get coordinates -->
885
				<xsl:for-each select="COORDS">
886
 
887
						<xsl:attribute name="x">
888
							<xsl:value-of select="@x" />
889
						</xsl:attribute>
890
						<xsl:attribute name="y">
891
							<xsl:value-of select="@y" />
892
						</xsl:attribute>
893
						<xsl:attribute name="w">
894
							<xsl:value-of select="@w" />
895
						</xsl:attribute>
896
						<xsl:attribute name="h">
897
							<xsl:value-of select="@h" />
898
						</xsl:attribute>
899
						<xsl:attribute name="angle">
900
							<xsl:value-of select="@angle" />
901
						</xsl:attribute>
902
						<xsl:for-each select="attribute::*">
903
							<xsl:if test = "not(name(.) = 'x')">
904
							<xsl:if test = "not(name(.) = 'y')">
905
							<xsl:if test = "not(name(.) = 'w')">
906
							<xsl:if test = "not(name(.) = 'h')">
907
							<xsl:if test = "not(name(.) = 'angle')">
908
								<xsl:attribute name="{name(.)}">
909
									<xsl:value-of select="self::node()" />
910
								</xsl:attribute>
911
							</xsl:if></xsl:if></xsl:if></xsl:if></xsl:if>
912
						</xsl:for-each>
913
						<xsl:for-each select="node()">
914
							<xsl:copy-of select="self::node()" />
915
						</xsl:for-each>
916
					</xsl:element>
917
				</xsl:for-each>
918
				<!-- copy all other childs -->
919
				<xsl:for-each select="node()">
920
					<xsl:if test = "not(name(.) = 'COORDS')">
921
						<xsl:copy-of select="self::node()" />
922
					</xsl:if>
923
				</xsl:for-each>
924
			</xsl:element>
925
		</xsl:for-each>
926
927
		<!-- get information of used polyline out of child 'POLYLINE' -->
928
		<xsl:for-each select="POLYLINE">
929
			<xsl:element name="POLYLINE">
930
				<!-- get coordinates -->
931
				<xsl:for-each select="COORDS">
932
 
933
						<xsl:attribute name="x">
934
							<xsl:value-of select="@x" />
935
						</xsl:attribute>
936
						<xsl:attribute name="y">
937
							<xsl:value-of select="@y" />
938
						</xsl:attribute>
939
						<xsl:for-each select="attribute::*">
940
							<xsl:if test = "not(name(.) = 'x')">
941
							<xsl:if test = "not(name(.) = 'y')">
942
								<xsl:attribute name="{name(.)}">
943
									<xsl:value-of select="self::node()" />
944
								</xsl:attribute>
945
							</xsl:if></xsl:if>
946
						</xsl:for-each>
947
						<xsl:for-each select="node()">
948
							<xsl:copy-of select="self::node()" />
949
						</xsl:for-each>
950
					</xsl:element>
951
				</xsl:for-each>
952
				<!-- copy all other childs -->
953
				<xsl:for-each select="node()">
954
					<xsl:if test = "not(name(.) = 'COORDS')">
955
						<xsl:copy-of select="self::node()" />
956
					</xsl:if>
957
				</xsl:for-each>
958
			</xsl:element>
959
		</xsl:for-each>
960
961
		<!-- copy all other childs -->
962
		<xsl:for-each select="node()">
963
			<xsl:if test = "not(name(.) = 'RECTANGLE')">
964
			<xsl:if test = "not(name(.) = 'ELLIPSE')">
965
			<xsl:if test = "not(name(.) = 'POLYLINE')">
966
 
967
			</xsl:if></xsl:if></xsl:if>
968
		</xsl:for-each>
969
970
	</xsl:element>
971
</xsl:template>
972
973
974
</xsl:stylesheet>PK
975
 
976
añ.	META-INF/þÊPK
545 swalkenh 977
978
 
979
 
240 swalkenh 980
Òrñ.+PwÀ
981
 
577 swalkenh 982
 
240 swalkenh 983
 
577 swalkenh 984
 
240 swalkenh 985
 
577 swalkenh 986
 
521 swalkenh 987
 
988
 
240 swalkenh 989
 
577 swalkenh 990