1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <!--
|
---|
4 |
|
---|
5 | websrv-typemap.xsl:
|
---|
6 | XSLT stylesheet that generates a typemap file from
|
---|
7 | VirtualBox.xidl for use with the gSOAP compilers.
|
---|
8 |
|
---|
9 | Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
10 |
|
---|
11 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | available from http://www.virtualbox.org. This file is free software;
|
---|
13 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | General Public License (GPL) as published by the Free Software
|
---|
15 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 |
|
---|
19 | Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
20 | Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
21 | additional information or have any questions.
|
---|
22 | -->
|
---|
23 |
|
---|
24 | <xsl:stylesheet
|
---|
25 | version="1.0"
|
---|
26 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
27 | xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
---|
28 |
|
---|
29 | <xsl:output method="text"/>
|
---|
30 |
|
---|
31 | <xsl:strip-space elements="*"/>
|
---|
32 |
|
---|
33 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
34 | global XSLT variables
|
---|
35 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
36 |
|
---|
37 | <xsl:variable name="G_xsltFilename" select="'websrv-typemap.xsl'" />
|
---|
38 |
|
---|
39 | <xsl:include href="websrv-shared.inc.xsl" />
|
---|
40 |
|
---|
41 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
42 | root match
|
---|
43 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
44 |
|
---|
45 | <xsl:template match="/idl">
|
---|
46 | <xsl:text><![CDATA[
|
---|
47 | # DO NOT EDIT! This is a generated file.
|
---|
48 | # Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
|
---|
49 | # Generator: src/VBox/Main/webservice/websrv-typemap.xsl
|
---|
50 |
|
---|
51 | # forces typedefs:
|
---|
52 | xsd__int = | long
|
---|
53 | xsd__unsignedInt = | unsigned long
|
---|
54 |
|
---|
55 | # xsd__short =| int16_t
|
---|
56 | # xsd__unsignedShort =| uint16_t
|
---|
57 | # xsd__int =| int32_t
|
---|
58 | # xsd__unsignedInt =| uint32_t
|
---|
59 | # xsd__long =| int64_t
|
---|
60 | # xsd__unsignedLong =| uint64_t
|
---|
61 |
|
---|
62 | # Main namespace (which is mapped to vbox__ prefixes):
|
---|
63 | ]]></xsl:text>
|
---|
64 | <xsl:value-of select="concat('vbox = "', $G_targetNamespace, '"')" />
|
---|
65 | <xsl:call-template name="emitNewline" />
|
---|
66 | <xsl:call-template name="emitNewline" />
|
---|
67 | <xsl:text># Namespaces for the interfaces in xidl that need to be mapped according to their wsmap attribs:</xsl:text>
|
---|
68 | <xsl:call-template name="emitNewline" />
|
---|
69 | <xsl:apply-templates />
|
---|
70 | </xsl:template>
|
---|
71 |
|
---|
72 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
73 | if
|
---|
74 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
75 |
|
---|
76 | <!--
|
---|
77 | * ignore all |if|s except those for WSDL target
|
---|
78 | -->
|
---|
79 | <xsl:template match="if">
|
---|
80 | <xsl:if test="@target='wsdl'">
|
---|
81 | <xsl:apply-templates/>
|
---|
82 | </xsl:if>
|
---|
83 | </xsl:template>
|
---|
84 |
|
---|
85 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
86 | cpp
|
---|
87 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
88 |
|
---|
89 | <xsl:template match="cpp">
|
---|
90 | <!-- ignore this -->
|
---|
91 | </xsl:template>
|
---|
92 |
|
---|
93 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
94 | library
|
---|
95 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
96 |
|
---|
97 | <xsl:template match="library">
|
---|
98 | <xsl:apply-templates />
|
---|
99 | </xsl:template>
|
---|
100 |
|
---|
101 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
102 | class
|
---|
103 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
104 |
|
---|
105 | <xsl:template match="module/class">
|
---|
106 | <!-- TODO swallow for now -->
|
---|
107 | </xsl:template>
|
---|
108 |
|
---|
109 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
110 | enum
|
---|
111 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
112 |
|
---|
113 | <xsl:template match="enum">
|
---|
114 | </xsl:template>
|
---|
115 |
|
---|
116 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
117 | const
|
---|
118 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
119 |
|
---|
120 | <!--
|
---|
121 | <xsl:template match="const">
|
---|
122 | <xsl:apply-templates />
|
---|
123 | </xsl:template>
|
---|
124 | -->
|
---|
125 |
|
---|
126 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
127 | desc
|
---|
128 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
129 |
|
---|
130 | <xsl:template match="desc">
|
---|
131 | <!-- TODO swallow for now -->
|
---|
132 | </xsl:template>
|
---|
133 |
|
---|
134 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
135 | note
|
---|
136 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
137 |
|
---|
138 | <xsl:template match="note">
|
---|
139 | <!-- TODO -->
|
---|
140 | <xsl:apply-templates />
|
---|
141 | </xsl:template>
|
---|
142 |
|
---|
143 | <xsl:template match="interface | collection">
|
---|
144 | <!-- remember the interface name in local variables -->
|
---|
145 | <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
|
---|
146 | <xsl:variable name="wsmap"><xsl:value-of select="@wsmap" /></xsl:variable>
|
---|
147 | <xsl:choose>
|
---|
148 | <xsl:when test="$wsmap='struct'" />
|
---|
149 | <xsl:when test="$wsmap='suppress'" />
|
---|
150 | <xsl:otherwise>
|
---|
151 | <xsl:value-of select="concat($ifname, ' = ', $G_targetNamespace, $G_targetNamespaceSeparator, $ifname, $G_bindingSuffix)" />
|
---|
152 | <xsl:call-template name="emitNewline" />
|
---|
153 | </xsl:otherwise>
|
---|
154 | </xsl:choose>
|
---|
155 | </xsl:template>
|
---|
156 |
|
---|
157 | </xsl:stylesheet>
|
---|