VirtualBox

Changeset 53920 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 22, 2015 3:21:55 PM (10 years ago)
Author:
vboxsync
Message:

midl.xsl,xpidl.xsl: Include typemap-shared.inc.xsl and use the utility templates there. Added a few calls to the 'xsltproc buffer flusher template'.

Location:
trunk/src/VBox/Main/idl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/midl.xsl

    r50855 r53920  
    2525<xsl:param name="g_fGenProxy" select="'no'"/>
    2626
    27 
    28 <!--
    29 //  helper definitions
    30 /////////////////////////////////////////////////////////////////////////////
    31 -->
    32 
    33 <!--
    34  *  capitalizes the first letter
    35 -->
    36 <xsl:template name="capitalize">
    37   <xsl:param name="str" select="."/>
    38   <xsl:value-of select="
    39     concat(
    40       translate(substring($str,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
    41       substring($str,2)
    42     )
    43   "/>
    44 </xsl:template>
    45 
    46 <!--
    47  *  uncapitalizes the first letter only if the second one is not capital
    48  *  otherwise leaves the string unchanged
    49 -->
    50 <xsl:template name="uncapitalize">
    51   <xsl:param name="str" select="."/>
    52   <xsl:choose>
    53     <xsl:when test="not(contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', substring($str,2,1)))">
    54       <xsl:value-of select="
    55         concat(
    56           translate(substring($str,1,1),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),
    57           substring($str,2)
    58         )
    59       "/>
    60     </xsl:when>
    61     <xsl:otherwise>
    62       <xsl:value-of select="string($str)"/>
    63     </xsl:otherwise>
    64   </xsl:choose>
    65 </xsl:template>
     27<xsl:include href="typemap-shared.inc.xsl"/>
    6628
    6729
     
    249211    <xsl:otherwise><xsl:value-of select="@extends"/></xsl:otherwise>
    250212  </xsl:choose>
    251   <xsl:text>&#x0A;{&#x0A;</xsl:text>
     213  <xsl:call-template name="xsltprocNewlineOutputHack"/>
     214  <xsl:text>{&#x0A;</xsl:text>
    252215  <!-- attributes (properties) -->
    253216  <xsl:apply-templates select="attribute"/>
  • trunk/src/VBox/Main/idl/xpidl.xsl

    r50183 r53920  
    2222<xsl:strip-space elements="*"/>
    2323
     24<xsl:include href="typemap-shared.inc.xsl"/>
    2425
    2526<!--
     
    2930
    3031<!--
    31  *  capitalizes the first letter
    32 -->
    33 <xsl:template name="capitalize">
    34   <xsl:param name="str" select="."/>
    35   <xsl:value-of select="
    36     concat(
    37       translate(substring($str,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
    38       substring($str,2)
    39     )
    40   "/>
    41 </xsl:template>
    42 
    43 <!--
    44  *  uncapitalizes the first letter only if the second one is not capital
    45  *  otherwise leaves the string unchanged
    46 -->
    47 <xsl:template name="uncapitalize">
    48   <xsl:param name="str" select="."/>
    49   <xsl:choose>
    50     <xsl:when test="not(contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', substring($str,2,1)))">
    51       <xsl:value-of select="
    52         concat(
    53           translate(substring($str,1,1),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),
    54           substring($str,2)
    55         )
    56       "/>
    57     </xsl:when>
    58     <xsl:otherwise>
    59       <xsl:value-of select="string($str)"/>
    60     </xsl:otherwise>
    61   </xsl:choose>
    62 </xsl:template>
    63 
    64 <!--
    6532 *  translates the string to uppercase
    6633-->
    6734<xsl:template name="uppercase">
    6835  <xsl:param name="str" select="."/>
    69   <xsl:value-of select="
    70     translate($str,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
    71   "/>
     36  <xsl:value-of select="translate($str, $G_lowerCase, $G_upperCase)"/>
    7237</xsl:template>
    7338
     
    247212      <xsl:otherwise><xsl:value-of select="@extends"/></xsl:otherwise>
    248213  </xsl:choose>
    249   <xsl:text>&#x0A;{&#x0A;</xsl:text>
     214  <xsl:call-template name="xsltprocNewlineOutputHack"/>
     215  <xsl:text>{&#x0A;</xsl:text>
    250216  <!-- attributes (properties) -->
    251217  <xsl:apply-templates select="attribute"/>
Note: See TracChangeset for help on using the changeset viewer.

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