root/juggler/branches/2.2/modules/vrjuggler/data/xslt/2.0a2-2.0a4.xsl

Revision 19729, 83.9 kB (checked in by patrick, 2 years ago)

Copyright update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!-- *********** <auto-copyright.pl BEGIN do not edit this line> *********** -->
4 <!--
5  VR Juggler is (C) Copyright 1998-2007 by Iowa State University
6
7  Original Authors:
8    Allen Bierbaum, Christopher Just,
9    Patrick Hartling, Kevin Meinert,
10    Carolina Cruz-Neira, Albert Baker
11
12  This library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU Library General Public
14  License as published by the Free Software Foundation; either
15  version 2 of the License, or (at your option) any later version.
16
17  This library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  Library General Public License for more details.
21
22  You should have received a copy of the GNU Library General Public
23  License along with this library; if not, write to the
24  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25  Boston, MA 02111-1307, USA.
26  -->
27 <!-- ************ <auto-copyright.pl END do not edit this line> ************ -->
28
29 <!--
30
31    This stylesheet provides an upgrade path for VR Juggler 2.0 Alpha 2 or
32    Alpha 3 configuration files to changes made for VR Juggler 2.0 Alpha 4.
33
34       xsltproc -o new-file.jconf 2.0a2-2.0a4.xsl old-file.config
35
36    or
37
38       xalan -in old-file.config -xsl 2.0a2-2.0a4.xsl -out new-file.jconf
39
40 -->
41
42 <xsl:stylesheet version="1.0"
43                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
44                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
45    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
46
47    <!-- Define a handy way to insert newlines when necessary. -->
48    <xsl:variable name="newline">
49 <xsl:text>
50 </xsl:text>
51    </xsl:variable>
52
53    <!-- The namespace for JCCL configuration files. -->
54    <xsl:variable name="cfg_namespace">
55       <xsl:text>http://www.vrjuggler.org/jccl/xsd/3.0/configuration</xsl:text>
56    </xsl:variable>
57
58    <!-- The schema for JCCL configuration files. -->
59    <xsl:variable name="cfg_schema">
60       <xsl:text>http://www.vrjuggler.org/jccl/xsd/3.0/configuration.xsd</xsl:text>
61    </xsl:variable>
62
63    <xsl:template match="/">
64      <!-- Add the new version information. -->
65      <xsl:processing-instruction name="org-vrjuggler-jccl-settings">configuration.version="3.0"</xsl:processing-instruction>
66       <xsl:value-of select="$newline"/>
67
68       <xsl:variable name="include_count">
69          <xsl:value-of select="count(processing-instruction('org-vrjuggler-jccl-include'))" />
70       </xsl:variable>
71
72       <!-- XXX: Need to deal with includes here. -->
73       <!-- Create the new XML tree. -->
74       <xsl:element name="configuration">
75          <!-- Fill in the attributes for the root node. -->
76          <!--
77             XXX: A good default value for this would be the name of the file.
78             How do we get that from the XSLT processor?
79          -->
80          <xsl:attribute name="name">
81             <xsl:text>Configuration</xsl:text>
82          </xsl:attribute>
83          <xsl:attribute name="xmlns:xsi">
84             <xsl:text>http://www.w3.org/2001/XMLSchema-instance</xsl:text>
85          </xsl:attribute>
86          <xsl:attribute name="xsi:schemaLocation">
87             <xsl:value-of select="$cfg_namespace" />
88             <xsl:text> </xsl:text>
89             <xsl:value-of select="$cfg_schema" />
90          </xsl:attribute>
91          <xsl:attribute name="xmlns">
92             <xsl:value-of select="$cfg_namespace" />
93          </xsl:attribute>
94          <xsl:value-of select="$newline"/>
95
96          <xsl:call-template name="for-loop">
97             <xsl:with-param name="i"         select="1" />
98             <xsl:with-param name="increment" select="1" />
99             <xsl:with-param name="operator"  select="'&lt;='" />
100             <xsl:with-param name="testValue" select="$include_count" />
101          </xsl:call-template>
102
103          <!-- Create the tree of elements. -->
104          <xsl:element name="elements">
105             <xsl:value-of select="$newline"/>
106             <xsl:for-each select="ConfigChunkDB/*">
107                <xsl:apply-templates select="."/>
108             </xsl:for-each>
109          </xsl:element>
110          <xsl:value-of select="$newline"/>
111       </xsl:element>
112
113       <xsl:message>
114          <xsl:text>Processing is complete.  You should now use VRJConfig</xsl:text>
115          <xsl:value-of select="$newline"/>
116          <xsl:text>to verify the results and make any necessary changes.</xsl:text>
117          <xsl:value-of select="$newline"/>
118       </xsl:message>
119    </xsl:template>
120
121
122 <!-- ThreeDMouse =========================================================== -->
123    <!-- Rename ThreeDMouse to three_d_mouse. -->
124    <xsl:template match="ThreeDMouse">
125       <xsl:element name="three_d_mouse">
126          <xsl:attribute name="name">
127             <xsl:value-of select="@name"/>
128          </xsl:attribute>
129          <xsl:attribute name="version">
130             <xsl:text>1</xsl:text>
131          </xsl:attribute>
132          <xsl:if test="count(./deviceHost) = 0">
133             <xsl:element name="device_host" />
134          </xsl:if>
135          <xsl:apply-templates select="./*" />
136       </xsl:element>
137       <xsl:value-of select="$newline"/>
138    </xsl:template>
139
140    <!-- ThreeDMouse property "deviceHost". -->
141    <xsl:template match="ThreeDMouse/deviceHost">
142       <xsl:element name="device_host">
143          <xsl:value-of select="." />
144       </xsl:element>
145       <xsl:value-of select="$newline"/>
146    </xsl:template>
147
148
149 <!-- AnaProxy ============================================================== -->
150    <!-- Rename AnaProxy to analog_proxy. -->
151    <xsl:template match="AnaProxy">
152       <xsl:element name="analog_proxy">
153          <xsl:attribute name="name">
154             <xsl:value-of select="@name"/>
155          </xsl:attribute>
156          <xsl:attribute name="version">
157             <xsl:text>1</xsl:text>
158          </xsl:attribute>
159          <xsl:apply-templates select="./*" />
160       </xsl:element>
161    </xsl:template>
162
163
164 <!-- SimAnalog ============================================================= -->
165    <!-- Rename SimAnalog to simulated_analog_device. -->
166    <xsl:template match="SimAnalog">
167       <xsl:element name="simulated_analog_device">
168          <xsl:attribute name="name">
169             <xsl:value-of select="@name"/>
170          </xsl:attribute>
171          <xsl:attribute name="version">
172             <xsl:text>1</xsl:text>
173          </xsl:attribute>
174          <xsl:if test="count(./deviceHost) = 0">
175             <xsl:element name="device_host" />
176          </xsl:if>
177          <xsl:apply-templates select="./*" />
178       </xsl:element>
179    </xsl:template>
180
181    <!-- SimAnalog property "eventWindowProxy". -->
182    <xsl:template match="SimAnalog/eventWindowProxy">
183       <xsl:element name="event_window_proxy">
184          <xsl:value-of select="." />
185       </xsl:element>
186    </xsl:template>
187
188    <!-- SimAnalog property "keyPairsInc". -->
189    <xsl:template match="SimAnalog/keyPairsInc">
190       <xsl:element name="increment_keypress">
191          <xsl:apply-templates select="./*" />
192       </xsl:element>
193    </xsl:template>
194
195    <!-- SimAnalog property "keyPairsDec". -->
196    <xsl:template match="SimAnalog/keyPairsDec">
197       <xsl:element name="decrement_keypress">
198          <xsl:apply-templates select="./*" />
199       </xsl:element>
200    </xsl:template>
201
202    <!-- SimAnalog property "anastep". -->
203    <xsl:template match="SimAnalog/anastep">
204       <xsl:element name="delta">
205          <xsl:value-of select="." />
206       </xsl:element>
207    </xsl:template>
208
209
210 <!-- AppData =============================================================== -->
211    <!-- Rename AppData to application_data. -->
212    <xsl:template match="AppData">
213       <xsl:element name="application_data">
214          <xsl:attribute name="name">
215             <xsl:value-of select="@name"/>
216          </xsl:attribute>
217          <xsl:attribute name="version">
218             <xsl:text>1</xsl:text>
219          </xsl:attribute>
220          <xsl:apply-templates select="./*" />
221       </xsl:element>
222    </xsl:template>
223
224
225 <!-- AwSoundEngine ========================================================= -->
226    <!-- Rename AwSoundEngine to audioworks_sound_engine. -->
227    <xsl:template match="AwSoundEngine">
228       <!-- Drop these.  They are no longer used. -->
229    </xsl:template>
230
231
232 <!-- ClusterManager ======================================================== -->
233    <!-- Rename ClusterManager to cluster_manager. -->
234    <xsl:template match="ClusterManager">
235       <xsl:element name="cluster_manager">
236          <xsl:attribute name="name">
237             <xsl:value-of select="@name"/>
238          </xsl:attribute>
239          <xsl:attribute name="version">
240             <xsl:text>2</xsl:text>
241          </xsl:attribute>
242
243          <!--
244             If there are one or more plug-ins listed, get the path information
245             from the first.  This will be used for the new <plugin_path>
246             element.
247             XXX: This does not handle the case when there are different paths
248             used in the configuration.
249          -->
250          <xsl:if test="count(./clusterPlugin) &gt; 0">
251             <xsl:element name="plugin_path">
252                <xsl:call-template name="get-path">
253                   <xsl:with-param name="original" select="./clusterPlugin"/>
254                   <xsl:with-param name="path_sep"><xsl:text>/</xsl:text></xsl:with-param>
255                </xsl:call-template>
256             </xsl:element>
257             <xsl:value-of select="$newline"/>
258          </xsl:if>
259
260          <xsl:apply-templates select="./*" />
261       </xsl:element>
262    </xsl:template>
263
264    <!-- Drop ClusterManager property "barrier_master"; it is not used. -->
265    <xsl:template match="ClusterManager/barrier_master" />
266
267    <!-- ClusterManager property "cluster_nodes". -->
268    <xsl:template match="ClusterManager/cluster_nodes">
269       <xsl:element name="cluster_node">
270          <xsl:value-of select="." />
271       </xsl:element>
272    </xsl:template>
273
274    <!-- ClusterManager property "clusterPlugin". -->
275    <xsl:template match="ClusterManager/clusterPlugin">
276       <xsl:variable name="no_ext">
277          <xsl:choose>
278             <xsl:when test="contains(., '.dll')">
279                <xsl:value-of select="substring-before(., '.dll')"/>
280             </xsl:when>
281             <xsl:when test="contains(., '.dylib')">
282                <xsl:value-of select="substring-before(., '.dylib')"/>
283             </xsl:when>
284             <xsl:otherwise>
285                <xsl:value-of select="substring-before(., '.so')"/>
286             </xsl:otherwise>
287          </xsl:choose>
288       </xsl:variable>
289
290       <xsl:variable name="plugin_name">
291          <xsl:call-template name="strip-path">
292             <xsl:with-param name="original" select="$no_ext"/>
293             <xsl:with-param name="path_sep"><xsl:text>/</xsl:text></xsl:with-param>
294          </xsl:call-template>
295       </xsl:variable>
296
297       <xsl:element name="plugin">
298          <xsl:choose>
299             <xsl:when test="starts-with($plugin_name, 'lib')">
300                <xsl:value-of select="substring-after($plugin_name, 'lib')"/>
301             </xsl:when>
302             <xsl:otherwise>
303                <xsl:value-of select="$plugin_name"/>
304             </xsl:otherwise>
305          </xsl:choose>
306       </xsl:element>
307       <xsl:value-of select="$newline"/>
308    </xsl:template>
309
310
311 <!-- CyberGlove ============================================================ -->
312    <!-- Rename CyberGlove to cyber_glove. -->
313    <xsl:template match="CyberGlove">
314       <xsl:element name="cyber_glove">
315          <xsl:attribute name="name">
316             <xsl:value-of select="@name"/>
317          </xsl:attribute>
318          <xsl:attribute name="version">
319             <xsl:text>1</xsl:text>
320          </xsl:attribute>
321          <xsl:if test="count(./deviceHost) = 0">
322             <xsl:element name="device_host" />
323          </xsl:if>
324          <xsl:apply-templates select="./*" />
325       </xsl:element>
326    </xsl:template>
327
328    <!-- CyberGlove property "baud". -->
329    <xsl:template match="CyberGlove/baud">
330       <xsl:element name="baud_rate">
331          <xsl:value-of select="." />
332       </xsl:element>
333    </xsl:template>
334
335    <!-- CyberGlove property "calDir". -->
336    <xsl:template match="CyberGlove/calDir">
337       <xsl:element name="calibration_dir">
338          <xsl:value-of select="." />
339       </xsl:element>
340    </xsl:template>
341
342    <!-- CyberGlove property "glovePos". -->
343    <xsl:template match="CyberGlove/glovePos">
344       <xsl:element name="glove_position">
345          <xsl:value-of select="." />
346       </xsl:element>
347    </xsl:template>
348
349    <!-- CyberGlove property "deviceHost". -->
350    <xsl:template match="CyberGlove/deviceHost">
351       <xsl:element name="device_host">
352          <xsl:value-of select="." />
353       </xsl:element>
354    </xsl:template>
355
356
357 <!-- DTK =================================================================== -->
358    <!-- Rename DTK to dtk. -->
359    <xsl:template match="DTK">
360       <xsl:element name="dtk">
361          <xsl:attribute name="name">
362             <xsl:value-of select="@name"/>
363          </xsl:attribute>
364          <xsl:attribute name="version">
365             <xsl:text>1</xsl:text>
366          </xsl:attribute>
367          <xsl:apply-templates select="./*" />
368       </xsl:element>
369    </xsl:template>
370
371
372 <!-- DTKsegment ============================================================ -->
373    <!-- Rename DTKsegment to dtk_segment. -->
374    <xsl:template match="DTKsegment">
375       <xsl:element name="dtk_segment">
376          <xsl:attribute name="name">
377             <xsl:value-of select="@name"/>
378          </xsl:attribute>
379          <xsl:attribute name="version">
380             <xsl:text>1</xsl:text>
381          </xsl:attribute>
382          <xsl:apply-templates select="./*" />
383       </xsl:element>
384    </xsl:template>
385
386    <!-- DTKsegment property "segmentName". -->
387    <xsl:template match="DTKsegment/segmentName">
388       <xsl:element name="segment_name">
389          <xsl:value-of select="." />
390       </xsl:element>
391    </xsl:template>
392
393    <!-- DTKsegment property "remoteHost". -->
394    <xsl:template match="DTKsegment/remoteHost">
395       <xsl:element name="host_name">
396          <xsl:value-of select="." />
397       </xsl:element>
398    </xsl:template>
399
400    <!-- DTKsegment property "dataType". -->
401    <xsl:template match="DTKsegment/dataType">
402       <xsl:element name="data_type">
403          <xsl:value-of select="." />
404       </xsl:element>
405    </xsl:template>
406
407    <!-- DTKsegment property "itemCount". -->
408    <xsl:template match="DTKsegment/itemCount">
409       <xsl:element name="item_count">
410          <xsl:value-of select="." />
411       </xsl:element>
412    </xsl:template>
413
414    <!-- DTKsegment property "inputType". -->
415    <xsl:template match="DTKsegment/inputType">
416       <xsl:element name="input_type">
417          <xsl:value-of select="." />
418       </xsl:element>
419    </xsl:template>
420
421
422 <!-- DataGlove ============================================================= -->
423    <!-- Rename DataGlove to data_glove. -->
424    <xsl:template match="DataGlove">
425       <xsl:element name="data_glove">
426          <xsl:attribute name="name">
427             <xsl:value-of select="@name"/>
428          </xsl:attribute>
429          <xsl:attribute name="version">
430             <xsl:text>1</xsl:text>
431          </xsl:attribute>
432          <xsl:if test="count(./deviceHost) = 0">
433             <xsl:element name="device_host" />
434          </xsl:if>
435          <xsl:apply-templates select="./*" />
436       </xsl:element>
437    </xsl:template>
438
439    <!-- DataGlove property "glovePos". -->
440    <xsl:template match="DataGlove/glovePos">
441       <xsl:element name="glove_position">
442          <xsl:value-of select="." />
443       </xsl:element>
444    </xsl:template>
445
446    <!-- DataGlove property "deviceHost". -->
447    <xsl:template match="DataGlove/deviceHost">
448       <xsl:element name="device_host">
449          <xsl:value-of select="." />
450       </xsl:element>
451    </xsl:template>
452
453
454 <!-- Default Simulator ===================================================== -->
455    <!-- Keep the name the same, but add version information. -->
456    <xsl:template match="default_simulator">
457       <xsl:element name="default_simulator">
458          <xsl:attribute name="name">
459             <xsl:value-of select="@name"/>
460          </xsl:attribute>
461          <xsl:attribute name="version">
462             <xsl:text>3</xsl:text>
463          </xsl:attribute>
464          <xsl:apply-templates select="./*" />
465       </xsl:element>
466    </xsl:template>
467
468    <!-- default_simulator property "cameraPos". -->
469    <xsl:template match="default_simulator/cameraPos">
470       <xsl:element name="camera_pos">
471          <xsl:value-of select="." />
472       </xsl:element>
473    </xsl:template>
474
475    <!-- default_simulator property "wandPos". -->
476    <xsl:template match="default_simulator/wandPos">
477       <xsl:element name="wand_pos">
478          <xsl:value-of select="." />
479       </xsl:element>
480    </xsl:template>
481
482    <!-- default_simulator property "drawProjections". -->
483    <xsl:template match="default_simulator/drawProjections">
484       <xsl:element name="draw_projections">
485          <xsl:value-of select="." />
486       </xsl:element>
487    </xsl:template>
488
489    <!-- default_simulator property "surfaceColor". -->
490    <xsl:template match="default_simulator/surfaceColor">
491       <xsl:element name="surface_color">
492          <xsl:value-of select="." />
493       </xsl:element>
494    </xsl:template>
495
496    <!-- default_simulator property "simHeadModel". -->
497    <xsl:template match="default_simulator/simHeadModel">
498       <xsl:element name="head_model">
499          <xsl:value-of select="." />
500       </xsl:element>
501    </xsl:template>
502
503    <!-- default_simulator property "simWandModel". -->
504    <xsl:template match="default_simulator/simWandModel">
505       <xsl:element name="wand_model">
506          <xsl:value-of select="." />
507       </xsl:element>
508    </xsl:template>
509
510
511 <!-- DigProxy ============================================================== -->
512    <!-- Rename DigProxy to digital_proxy. -->
513    <xsl:template match="DigProxy">
514       <xsl:element name="digital_proxy">
515          <xsl:attribute name="name">
516             <xsl:value-of select="@name"/>
517          </xsl:attribute>
518          <xsl:attribute name="version">
519             <xsl:text>1</xsl:text>
520          </xsl:attribute>
521          <xsl:apply-templates select="./*" />
522       </xsl:element>
523    </xsl:template>
524
525
526 <!-- SimDigital ============================================================ -->
527    <!-- Rename SimDigital to simulated_digital_device. -->
528    <xsl:template match="SimDigital">
529       <xsl:element name="simulated_digital_device">
530          <xsl:attribute name="name">
531             <xsl:value-of select="@name"/>
532          </xsl:attribute>
533          <xsl:attribute name="version">
534             <xsl:text>1</xsl:text>
535          </xsl:attribute>
536          <xsl:if test="count(./deviceHost) = 0">
537             <xsl:element name="device_host" />
538          </xsl:if>
539          <xsl:apply-templates select="./*" />
540       </xsl:element>
541    </xsl:template>
542
543    <!-- SimDigital property "eventWindowProxy". -->
544    <xsl:template match="SimDigital/eventWindowProxy">
545       <xsl:element name="event_window_proxy">
546          <xsl:value-of select="." />
547       </xsl:element>
548    </xsl:template>
549
550    <!-- SimDigital property "keyPairs". -->
551    <xsl:template match="SimDigital/keyPairs">
552       <xsl:element name="key_pair">
553          <xsl:apply-templates select="./*" />
554       </xsl:element>
555    </xsl:template>
556
557
558 <!-- displaySystem ========================================================= -->
559    <!-- Rename displaySystem to display_system. -->
560    <xsl:template match="displaySystem">
561       <xsl:element name="display_system">
562          <xsl:attribute name="name">
563             <xsl:value-of select="@name"/>
564          </xsl:attribute>
565          <xsl:attribute name="version">
566             <xsl:text>1</xsl:text>
567          </xsl:attribute>
568          <xsl:apply-templates select="./*" />
569       </xsl:element>
570    </xsl:template>
571
572    <!-- displaySystem property "numpipes". -->
573    <xsl:template match="displaySystem/numpipes">
574       <xsl:element name="number_of_pipes">
575          <xsl:value-of select="." />
576       </xsl:element>
577    </xsl:template>
578
579    <!-- displaySystem property "xpipes". -->
580    <xsl:template match="displaySystem/xpipes">
581       <xsl:element name="x11_pipes">
582          <xsl:value-of select="." />
583       </xsl:element>
584    </xsl:template>
585
586
587 <!-- displayWindow ========================================================= -->
588    <!-- Rename displayWindow to display_window. -->
589    <xsl:template match="displayWindow">
590       <xsl:element name="display_window">
591          <xsl:attribute name="name">
592             <xsl:value-of select="@name"/>
593          </xsl:attribute>
594          <xsl:attribute name="version">
595             <xsl:text>2</xsl:text>
596          </xsl:attribute>
597          <xsl:value-of select="$newline"/>
598          <xsl:apply-templates select="./*" />
599       </xsl:element>
600       <xsl:value-of select="$newline"/>
601    </xsl:template>
602
603    <!-- displayWindow property "frameBufferConfig". -->
604    <xsl:template match="displayWindow/frameBufferConfig">
605       <xsl:element name="frame_buffer_config">
606          <xsl:value-of select="$newline"/>
607          <xsl:apply-templates select="./*" />
608       </xsl:element>
609       <xsl:value-of select="$newline"/>
610    </xsl:template>
611
612    <!--
613       displayWindow property "event_window_device" which contains a child
614       element that has been renamed.
615    -->
616    <xsl:template match="displayWindow/event_window_device">
617       <xsl:element name="event_window_device">
618          <xsl:value-of select="$newline"/>
619          <xsl:apply-templates select="./*" />
620       </xsl:element>
621       <xsl:value-of select="$newline"/>
622    </xsl:template>
623
624    <!-- displayWindow property "sim_viewports". -->
625    <xsl:template match="displayWindow/sim_viewports">
626       <xsl:element name="simulator_viewports">
627          <xsl:value-of select="$newline"/>
628          <xsl:apply-templates select="./*" />
629       </xsl:element>
630       <xsl:value-of select="$newline"/>
631    </xsl:template>
632
633    <!--
634       displayWindow property "surface_viewports" which contains a child
635       element that has been renamed.
636    -->
637    <xsl:template match="displayWindow/surface_viewports">
638       <xsl:element name="surface_viewports">
639          <xsl:value-of select="$newline"/>
640          <xsl:apply-templates select="./*" />
641       </xsl:element>
642       <xsl:value-of select="$newline"/>
643    </xsl:template>
644
645
646 <!-- EventWindow =========================================================== -->
647    <!-- Rename EventWindow to event_window. -->
648    <xsl:template match="EventWindow">
649       <xsl:element name="event_window">
650          <xsl:attribute name="name">
651             <xsl:value-of select="@name"/>
652          </xsl:attribute>
653          <xsl:attribute name="version">
654             <xsl:text>1</xsl:text>
655          </xsl:attribute>
656          <xsl:if test="count(./deviceHost) = 0">
657             <xsl:element name="device_host" />
658          </xsl:if>
659          <xsl:apply-templates select="./*" />
660       </xsl:element>
661    </xsl:template>
662
663    <!-- EventWindow property "msens". -->
664    <xsl:template match="EventWindow/msens">
665       <xsl:element name="mouse_sensitivity">
666          <xsl:value-of select="." />
667       </xsl:element>
668    </xsl:template>
669
670    <!-- EventWindow property "deviceHost". -->
671    <xsl:template match="EventWindow/deviceHost">
672       <xsl:element name="device_host">
673          <xsl:value-of select="." />
674       </xsl:element>
675    </xsl:template>
676
677
678 <!-- EventWindowProxy ====================================================== -->
679    <!-- Rename EventWindowProxy to event_window_proxy. -->
680    <xsl:template match="EventWindowProxy">
681       <xsl:element name="event_window_proxy">
682          <xsl:attribute name="name">
683             <xsl:value-of select="@name"/>
684          </xsl:attribute>
685          <xsl:attribute name="version">
686             <xsl:text>1</xsl:text>
687          </xsl:attribute>
688          <xsl:apply-templates select="./*" />
689       </xsl:element>
690    </xsl:template>
691
692
693 <!-- Fastrak =============================================================== -->
694    <!-- Rename Fastrak to fastrak. -->
695    <xsl:template match="Fastrak">
696       <xsl:element name="fastrak">
697          <xsl:attribute name="name">
698             <xsl:value-of select="@name"/>
699          </xsl:attribute>
700          <xsl:attribute name="version">
701             <xsl:text>1</xsl:text>
702          </xsl:attribute>
703          <xsl:if test="count(./deviceHost) = 0">
704             <xsl:element name="device_host" />
705          </xsl:if>
706          <xsl:apply-templates select="./*" />
707       </xsl:element>
708    </xsl:template>
709
710    <!-- Fastrak property "Rec1". -->
711    <xsl:template match="Fastrak/Rec1">
712       <xsl:element name="rec1">
713          <xsl:value-of select="." />
714       </xsl:element>
715    </xsl:template>
716
717    <!-- Fastrak property "Rec2". -->
718    <xsl:template match="Fastrak/Rec2">
719       <xsl:element name="rec2">
720          <xsl:value-of select="." />
721       </xsl:element>
722    </xsl:template>
723
724    <!-- Fastrak property "Rec3". -->
725    <xsl:template match="Fastrak/Rec3">
726       <xsl:element name="rec3">
727          <xsl:value-of select="." />
728       </xsl:element>
729    </xsl:template>
730
731    <!-- Fastrak property "Rec4". -->
732    <xsl:template match="Fastrak/Rec4">
733       <xsl:element name="rec4">
734          <xsl:value-of select="." />
735       </xsl:element>
736    </xsl:template>
737
738    <!-- Fastrak property "Tip1". -->
739    <xsl:template match="Fastrak/Tip1">
740       <xsl:element name="tip1">
741          <xsl:value-of select="." />
742       </xsl:element>
743    </xsl:template>
744
745    <!-- Fastrak property "Tip2". -->
746    <xsl:template match="Fastrak/Tip2">
747       <xsl:element name="tip2">
748          <xsl:value-of select="." />
749       </xsl:element>
750    </xsl:template>
751
752    <!-- Fastrak property "Tip3". -->
753    <xsl:template match="Fastrak/Tip3">
754       <xsl:element name="tip3">
755          <xsl:value-of select="." />
756       </xsl:element>
757    </xsl:template>
758
759    <!-- Fastrak property "Tip4". -->
760    <xsl:template match="Fastrak/Tip4">
761       <xsl:element name="tip4">
762          <xsl:value-of select="." />
763       </xsl:element>
764    </xsl:template>
765
766    <!-- Fastrak property "Inc1". -->
767    <xsl:template match="Fastrak/Inc1">
768       <xsl:element name="inc1">
769          <xsl:value-of select="." />
770       </xsl:element>
771    </xsl:template>
772
773    <!-- Fastrak property "Inc2". -->
774    <xsl:template match="Fastrak/Inc2">
775       <xsl:element name="inc2">
776          <xsl:value-of select="." />
777       </xsl:element>
778    </xsl:template>
779
780    <!-- Fastrak property "Inc3". -->
781    <xsl:template match="Fastrak/Inc3">
782       <xsl:element name="inc3">
783          <xsl:value-of select="." />
784       </xsl:element>
785    </xsl:template>
786
787    <!-- Fastrak property "Inc4". -->
788    <xsl:template match="Fastrak/Inc4">
789       <xsl:element name="inc4">
790          <xsl:value-of select="." />
791       </xsl:element>
792    </xsl:template>
793
794    <!-- Fastrak property "Hem1". -->
795    <xsl:template match="Fastrak/Hem1">
796       <xsl:element name="hem1">
797          <xsl:value-of select="." />
798       </xsl:element>
799    </xsl:template>
800
801    <!-- Fastrak property "Hem2". -->
802    <xsl:template match="Fastrak/Hem2">
803       <xsl:element name="hem2">
804          <xsl:value-of select="." />
805       </xsl:element>
806    </xsl:template>
807
808    <!-- Fastrak property "Hem3". -->
809    <xsl:template match="Fastrak/Hem3">
810       <xsl:element name="hem3">
811          <xsl:value-of select="." />
812       </xsl:element>
813    </xsl:template>
814
815    <!-- Fastrak property "Hem4". -->
816    <xsl:template match="Fastrak/Hem4">
817       <xsl:element name="hem4">
818          <xsl:value-of select="." />
819       </xsl:element>
820    </xsl:template>
821
822    <!-- Fastrak property "ARF1". -->
823    <xsl:template match="Fastrak/ARF1">
824       <xsl:element name="arf1">
825          <xsl:value-of select="." />
826       </xsl:element>
827    </xsl:template>
828
829    <!-- Fastrak property "ARF2". -->
830    <xsl:template match="Fastrak/ARF2">
831       <xsl:element name="arf2">
832          <xsl:value-of select="." />
833       </xsl:element>
834    </xsl:template>
835
836    <!-- Fastrak property "ARF3". -->
837    <xsl:template match="Fastrak/ARF3">
838       <xsl:element name="arf3">
839          <xsl:value-of select="." />
840       </xsl:element>
841    </xsl:template>
842
843    <!-- Fastrak property "ARF4". -->
844    <xsl:template match="Fastrak/ARF4">
845       <xsl:element name="arf4">
846          <xsl:value-of select="." />
847       </xsl:element>
848    </xsl:template>
849
850    <!-- Fastrak property "TMF1". -->
851    <xsl:template match="Fastrak/TMF1">
852       <xsl:element name="tmf1">
853          <xsl:value-of select="." />
854       </xsl:element>
855    </xsl:template>
856
857    <!-- Fastrak property "TMF2". -->
858    <xsl:template match="Fastrak/TMF2">
859       <xsl:element name="tmf2">
860          <xsl:value-of select="." />
861       </xsl:element>
862    </xsl:template>
863
864    <!-- Fastrak property "TMF3". -->
865    <xsl:template match="Fastrak/TMF3">
866       <xsl:element name="tmf3">
867          <xsl:value-of select="." />
868       </xsl:element>
869    </xsl:template>
870
871    <!-- Fastrak property "TMF4". -->
872    <xsl:template match="Fastrak/TMF4">
873       <xsl:element name="tmf4">
874          <xsl:value-of select="." />
875       </xsl:element>
876    </xsl:template>
877
878    <!-- Fastrak property "deviceHost". -->
879    <xsl:template match="Fastrak/deviceHost">
880       <xsl:element name="device_host">
881          <xsl:value-of select="." />
882       </xsl:element>
883    </xsl:template>
884
885
886 <!-- Flock ================================================================= -->
887    <!-- Rename Flock to flock. -->
888    <xsl:template match="Flock">
889       <xsl:element name="flock">
890          <xsl:attribute name="name">
891             <xsl:value-of select="@name"/>
892          </xsl:attribute>
893          <xsl:attribute name="version">
894             <xsl:text>1</xsl:text>
895          </xsl:attribute>
896          <xsl:if test="count(./deviceHost) = 0">
897             <xsl:element name="device_host" />
898          </xsl:if>
899          <xsl:apply-templates select="./*" />
900       </xsl:element>
901    </xsl:template>
902
903    <!-- Flock property "num". -->
904    <xsl:template match="Flock/num">
905       <xsl:element name="number_of_birds">
906          <xsl:value-of select="." />
907       </xsl:element>
908    </xsl:template>
909
910    <!-- Flock property "calfile". -->
911    <xsl:template match="Flock/calfile">
912       <xsl:element name="calibration_file">
913          <xsl:value-of select="." />
914       </xsl:element>
915    </xsl:template>
916
917    <!-- Flock property "hemi". -->
918    <xsl:template match="Flock/hemi">
919       <xsl:element name="hemisphere">
920          <xsl:value-of select="." />
921       </xsl:element>
922    </xsl:template>
923
924    <!-- Flock property "filt". -->
925    <xsl:template match="Flock/filt">
926       <xsl:element name="filter">
927          <xsl:value-of select="." />
928       </xsl:element>
929    </xsl:template>
930
931    <!-- Flock property "sync". -->
932    <xsl:template match="Flock/sync">
933       <xsl:element name="sync_style">
934          <xsl:value-of select="." />
935       </xsl:element>
936    </xsl:template>
937
938    <!-- Flock property "transmitter". -->
939    <xsl:template match="Flock/transmitter">
940       <xsl:element name="transmitter_id">
941          <xsl:value-of select="." />
942       </xsl:element>
943    </xsl:template>
944
945    <!-- Flock property "extendedRange". -->
946    <xsl:template match="Flock/extendedRange">
947       <xsl:element name="extended_range">
948          <xsl:value-of select="." />
949       </xsl:element>
950    </xsl:template>
951
952    <!-- Flock property "deviceHost". -->
953    <xsl:template match="Flock/deviceHost">
954       <xsl:element name="device_host">
955          <xsl:value-of select="." />
956       </xsl:element>
957    </xsl:template>
958
959    <!-- Flock property "position_filters". -->
960    <xsl:template match="Flock/position_filters">
961       <xsl:element name="position_filters">
962          <xsl:apply-templates select="./*" />
963       </xsl:element>
964    </xsl:template>
965
966
967 <!-- gadget_logger ========================================================= -->
968    <!-- Keep the name the same, but add version information. -->
969    <xsl:template match="gadget_logger">
970       <xsl:element name="gadget_logger">
971          <xsl:attribute name="name">
972             <xsl:value-of select="@name"/>
973          </xsl:attribute>
974          <xsl:attribute name="version">
975             <xsl:text>1</xsl:text>
976          </xsl:attribute>
977          <xsl:apply-templates select="./*" />
978       </xsl:element>
979    </xsl:template>
980
981
982 <!-- GestureProxy ========================================================== -->
983    <!-- Rename GestureProxy to gesture_proxy. -->
984    <xsl:template match="GestureProxy">
985       <xsl:element name="gesture_proxy">
986          <xsl:attribute name="name">
987             <xsl:value-of select="@name"/>
988          </xsl:attribute>
989          <xsl:attribute name="version">
990             <xsl:text>1</xsl:text>
991          </xsl:attribute>
992          <xsl:apply-templates select="./*" />
993       </xsl:element>
994    </xsl:template>
995
996
997 <!-- SimGloveGesture ======================================================= -->
998    <!-- Rename SimGloveGesture to simulated_glove_gesture. -->
999    <xsl:template match="SimGloveGesture">
1000       <xsl:element name="simulated_glove_gesture">
1001          <xsl:attribute name="name">
1002             <xsl:value-of select="@name"/>
1003          </xsl:attribute>
1004          <xsl:attribute name="version">
1005             <xsl:text>2</xsl:text>
1006          </xsl:attribute>
1007          <xsl:if test="count(./deviceHost) = 0">
1008             <xsl:element name="device_host" />
1009          </xsl:if>
1010          <xsl:apply-templates select="./*" />
1011       </xsl:element>
1012    </xsl:template>
1013
1014    <!-- SimGloveGesture property "eventWindowProxy". -->
1015    <xsl:template match="SimGloveGesture/eventWindowProxy">
1016