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