VirtualBox

Changeset 53933 in vbox for trunk/src/VBox/Main/webservice


Ignore:
Timestamp:
Jan 22, 2015 5:56:19 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97809
Message:

websrv-wsdl.xsl: Use keys for eaching all interface and enum elements. Drop unnecessary when case in emitConvertedType that will be handled by the otherwise element. (C)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/websrv-wsdl.xsl

    r46478 r53933  
    1010        generated for the webservice.
    1111
    12     Copyright (C) 2006-2013 Oracle Corporation
     12    Copyright (C) 2006-2015 Oracle Corporation
    1313
    1414    This file is part of VirtualBox Open Source Edition (OSE), as
     
    133133<xsl:variable name="G_typeIsGlobalResponseElementMarker"
    134134              select="'&lt;&lt;&lt;&lt;Response'" />
     135
     136<!-- - - - - - - - - - - - - - - - - - - - - - -
     137  Keys for more efficiently looking up of types.
     138 - - - - - - - - - - - - - - - - - - - - - - -->
     139
     140<xsl:key name="G_keyEnumsByName" match="//enum[@name]" use="@name"/>
     141<xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/>
     142
    135143
    136144<!--**********************************************************************
     
    160168    <xsl:when test="$type='explicit'"><xsl:value-of select="$G_typeObjectRef" /></xsl:when>
    161169    <!-- enums are easy, these are defined in schema at the top of the wsdl -->
    162     <xsl:when test="//enum[@name=$type]"><xsl:value-of select="concat('vbox:', $type)" /></xsl:when>
     170    <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0"><xsl:value-of select="concat('vbox:', $type)" /></xsl:when>
    163171    <!-- otherwise test for an interface with this name -->
    164     <xsl:when test="//interface[@name=$type]">
     172    <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0">
    165173      <!-- the type is one of our own interfaces: then it must have a wsmap attr -->
    166       <xsl:variable name="wsmap" select="//interface[@name=$type]/@wsmap" />
     174      <xsl:variable name="wsmap" select="key('G_keyInterfacesByName', $type)/@wsmap" />
    167175      <xsl:choose>
    168         <xsl:when test="not($wsmap)">
    169           <xsl:call-template name="fatalError">
    170             <xsl:with-param name="msg" select="concat('emitConvertedType: Type &quot;', $type, '&quot; in method &quot;', $ifname, '::', $methodname, '&quot; lacks wsmap attribute value in XIDL.')" />
    171           </xsl:call-template>
    172         </xsl:when>
    173176        <xsl:when test="$wsmap='struct'"><xsl:value-of select="concat('vbox:', $type)" /></xsl:when>
    174177        <xsl:when test="$wsmap='global'"><xsl:value-of select="$G_typeObjectRef" /></xsl:when>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette