1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <!--
|
---|
4 | * A template to generate a WiX include file that contains
|
---|
5 | * type library definitions for VirtualBox COM components
|
---|
6 | * from the generic interface definition expressed in XML.
|
---|
7 |
|
---|
8 | Copyright (C) 2007-2010 Oracle Corporation
|
---|
9 |
|
---|
10 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | available from http://www.virtualbox.org. This file is free software;
|
---|
12 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | General Public License (GPL) as published by the Free Software
|
---|
14 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | -->
|
---|
18 |
|
---|
19 | <xsl:stylesheet version="1.0"
|
---|
20 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
---|
21 |
|
---|
22 | <xsl:output method="xml"
|
---|
23 | version="1.0"
|
---|
24 | encoding="utf-8"
|
---|
25 | indent="yes"/>
|
---|
26 |
|
---|
27 | <xsl:strip-space elements="*"/>
|
---|
28 |
|
---|
29 |
|
---|
30 | <!--
|
---|
31 | // templates
|
---|
32 | /////////////////////////////////////////////////////////////////////////////
|
---|
33 | -->
|
---|
34 |
|
---|
35 | <!--
|
---|
36 | * header
|
---|
37 | -->
|
---|
38 | <xsl:template match="/idl">
|
---|
39 | <xsl:comment>
|
---|
40 | /*
|
---|
41 | * DO NOT EDIT! This is a generated file.
|
---|
42 | *
|
---|
43 | * WiX include script for the VirtualBox Type Library
|
---|
44 | * generated from XIDL (XML interface definition).
|
---|
45 | *
|
---|
46 | * Source : src/VBox/Main/idl/VirtualBox.xidl
|
---|
47 | * Generator : src/VBox/Installer/VirtualBox_TypeLib.xsl
|
---|
48 | */
|
---|
49 | </xsl:comment>
|
---|
50 | <xsl:apply-templates/>
|
---|
51 | </xsl:template>
|
---|
52 |
|
---|
53 |
|
---|
54 | <!--
|
---|
55 | * libraries
|
---|
56 | -->
|
---|
57 | <xsl:template match="idl/library">
|
---|
58 | <Include>
|
---|
59 | <TypeLib>
|
---|
60 | <xsl:attribute name="Id"><xsl:value-of select="@uuid"/></xsl:attribute>
|
---|
61 | <xsl:attribute name="Advertise">yes</xsl:attribute>
|
---|
62 | <xsl:attribute name="MajorVersion">1</xsl:attribute>
|
---|
63 | <xsl:attribute name="MinorVersion">0</xsl:attribute>
|
---|
64 | <xsl:attribute name="Language">0</xsl:attribute>
|
---|
65 | <xsl:attribute name="Description"><xsl:value-of select="@desc"/></xsl:attribute>
|
---|
66 | <AppId>
|
---|
67 | <xsl:attribute name="Id"><xsl:value-of select="@appUuid"/></xsl:attribute>
|
---|
68 | <xsl:attribute name="Description"><xsl:value-of select="@name"/> Application</xsl:attribute>
|
---|
69 | <xsl:apply-templates select="module/class"/>
|
---|
70 | </AppId>
|
---|
71 | </TypeLib>
|
---|
72 | </Include>
|
---|
73 | </xsl:template>
|
---|
74 |
|
---|
75 |
|
---|
76 | <!--
|
---|
77 | * classes
|
---|
78 | -->
|
---|
79 | <xsl:template match="library//module/class">
|
---|
80 | <Class>
|
---|
81 | <xsl:attribute name="Id"><xsl:value-of select="@uuid"/></xsl:attribute>
|
---|
82 | <xsl:attribute name="Description"><xsl:value-of select="@name"/> Class</xsl:attribute>
|
---|
83 | <xsl:attribute name="Server"><xsl:value-of select="../@name"/></xsl:attribute>
|
---|
84 | <xsl:attribute name="Context">
|
---|
85 | <xsl:choose>
|
---|
86 | <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when>
|
---|
87 | <xsl:when test="../@context='LocalServer'">LocalServer32</xsl:when>
|
---|
88 | <xsl:otherwise>
|
---|
89 | <xsl:message terminate="yes">
|
---|
90 | <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>
|
---|
91 | <xsl:text>module context </xsl:text>
|
---|
92 | <xsl:value-of select="concat('"',../@context,'"')"/>
|
---|
93 | <xsl:text> is invalid!</xsl:text>
|
---|
94 | </xsl:message>
|
---|
95 | </xsl:otherwise>
|
---|
96 | </xsl:choose>
|
---|
97 | </xsl:attribute>
|
---|
98 | <xsl:if test="../@context='InprocServer'">
|
---|
99 | <xsl:variable name="tmodel" select="(./@threadingModel | ../@threadingModel)[last()]"/>
|
---|
100 | <xsl:attribute name="ThreadingModel">
|
---|
101 | <xsl:choose>
|
---|
102 | <xsl:when test="$tmodel='Apartment'">apartment</xsl:when>
|
---|
103 | <xsl:when test="$tmodel='Free'">free</xsl:when>
|
---|
104 | <xsl:when test="$tmodel='Both'">both</xsl:when>
|
---|
105 | <xsl:when test="$tmodel='Neutral'">neutral</xsl:when>
|
---|
106 | <xsl:when test="$tmodel='Single'">single</xsl:when>
|
---|
107 | <xsl:when test="$tmodel='Rental'">rental</xsl:when>
|
---|
108 | <xsl:otherwise>
|
---|
109 | <xsl:message terminate="yes">
|
---|
110 | <xsl:value-of select="concat(../../@name,'::',@name,': ')"/>
|
---|
111 | <xsl:text>class (or module) threading model </xsl:text>
|
---|
112 | <xsl:value-of select="concat('"',$tmodel,'"')"/>
|
---|
113 | <xsl:text> is invalid!</xsl:text>
|
---|
114 | </xsl:message>
|
---|
115 | </xsl:otherwise>
|
---|
116 | </xsl:choose>
|
---|
117 | </xsl:attribute>
|
---|
118 | </xsl:if>
|
---|
119 | <ProgId>
|
---|
120 | <xsl:attribute name="Id">
|
---|
121 | <xsl:value-of select="concat(//library/@name,'.',@name,'.1')"/>
|
---|
122 | </xsl:attribute>
|
---|
123 | <xsl:attribute name="Description"><xsl:value-of select="@name"/> Class</xsl:attribute>
|
---|
124 | <ProgId>
|
---|
125 | <xsl:attribute name="Id">
|
---|
126 | <xsl:value-of select="concat(//library/@name,'.',@name)"/>
|
---|
127 | </xsl:attribute>
|
---|
128 | <xsl:attribute name="Description"><xsl:value-of select="@name"/> Class</xsl:attribute>
|
---|
129 | </ProgId>
|
---|
130 | </ProgId>
|
---|
131 | </Class>
|
---|
132 | </xsl:template>
|
---|
133 |
|
---|
134 |
|
---|
135 | <!--
|
---|
136 | * eat everything else not explicitly matched
|
---|
137 | -->
|
---|
138 | <xsl:template match="*">
|
---|
139 | </xsl:template>
|
---|
140 |
|
---|
141 |
|
---|
142 | </xsl:stylesheet>
|
---|