Changeset 53943 in vbox for trunk/src/libs/xpcom18a4/java/tools
- Timestamp:
- Jan 23, 2015 2:49:51 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/java/tools/genjifaces.xsl
r46478 r53943 33 33 <xsl:variable name="G_xsltFilename" select="'genjifaces.xsl'" /> 34 34 35 36 <!-- - - - - - - - - - - - - - - - - - - - - - - 37 Keys for more efficiently looking up of types. 38 - - - - - - - - - - - - - - - - - - - - - - --> 39 <xsl:key name="G_keyEnumsByName" match="//enum[@name]" use="@name"/> 40 <xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/> 41 42 <!-- 43 xsltprocNewlineOutputHack - emits a single new line. 44 45 Hack Alert! This template helps xsltproc split up the output text elements 46 and avoid reallocating them into the MB range. Calls to this 47 template is made occationally while generating larger output 48 file. It's not necessary for small stuff like header. 49 50 The trick we're playing on xsltproc has to do with CDATA 51 and/or the escape setting of the xsl:text element. It forces 52 xsltproc to allocate a new output element, thus preventing 53 things from growing out of proportions and slowing us down. 54 55 This was successfully employed to reduce a 18+ seconds run to 56 around one second (possibly less due to kmk overhead). 57 --> 58 <xsl:template name="xsltprocNewlineOutputHack"> 59 <xsl:text disable-output-escaping="yes"><![CDATA[ 60 ]]></xsl:text> 61 </xsl:template> 62 35 63 <xsl:template name="uppercase"> 36 64 <xsl:param name="str" select="."/> … … 68 96 <xsl:param name="name" /> 69 97 <xsl:text>/** 70 * Copyright (C) 2010-201 3Oracle Corporation98 * Copyright (C) 2010-2015 Oracle Corporation 71 99 * 72 100 * This file is part of VirtualBox Open Source Edition (OSE), as … … 103 131 <xsl:template name="endFile"> 104 132 <xsl:param name="file" /> 105 <xsl:value-of select="concat(' // ##### ENDFILE "', $file, '" ')" /> 133 <xsl:value-of select="concat(' // ##### ENDFILE "', $file, '" ')" /> 134 <xsl:call-template name="xsltprocNewlineOutputHack"/> 106 135 </xsl:template> 107 136 … … 371 400 </xsl:when> 372 401 373 <xsl:when test=" //interface[@name=$type]">402 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0"> 374 403 <xsl:value-of select="$type" /> 375 404 </xsl:when> 376 405 377 <xsl:when test=" //enum[@name=$type]">406 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0"> 378 407 <xsl:value-of select="'long'" /> 379 408 </xsl:when> … … 395 424 </xsl:call-template> 396 425 397 <xsl:variable name="extendsidl" select=" //interface[@name=$ifname]/@extends" />426 <xsl:variable name="extendsidl" select="key('G_keyInterfacesByName', $ifname)/@extends" /> 398 427 399 428 <xsl:variable name="extends">
Note:
See TracChangeset
for help on using the changeset viewer.