</xsl:template>
<xsl:template match="*" mode="generate.id">
- <xsl:value-of select="generate-id(.)"/>
+ <xsl:variable name="raw.id"><xsl:call-template name="object.id"/></xsl:variable>
+ <xsl:value-of select="translate($raw.id, '.', '_')"/>
<xsl:text>-bb</xsl:text>
</xsl:template>
+ <xsl:template name="postfix.id">
+ <xsl:variable name="raw.id"><xsl:call-template name="object.id"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($raw.id, 'id-')">
+ <xsl:value-of select="translate(substring-after($raw.id, 'id-'), '.', '_')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$raw.id"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<xsl:template name="strip-qualifiers-non-template">
<xsl:param name="name"/>
<xsl:choose>
translate($part, '.<>;\:*?"| ', '') != $part
)">
<xsl:variable name="normalized" select="translate(normalize-space(translate($part, '.<>;\:*?"|_', ' ')), ' ', '_')"/>
+ <xsl:variable name="id"><xsl:call-template name="postfix.id"/></xsl:variable>
<xsl:value-of select =
"concat(
- substring($normalized, 1, $boost.max.id.part.length - string-length(generate-id(.)) - 1),
- concat('_', generate-id(.)))"/>
+ substring($normalized, 1, $boost.max.id.part.length - string-length($id) - 1),
+ concat('_', $id))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$part"/>
</xsl:template>
<xsl:template match="function|overloaded-function" mode="unique.name">
- <xsl:value-of select="number(count(key('named-entities',
- translate(@name, $uppercase-letters, $lowercase-letters))) = 1)"/>
+ <xsl:variable name="func-name">
+ <xsl:call-template name="fully-qualified-name">
+ <xsl:with-param name="node" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Count the number of elements with the same qualified name -->
+ <xsl:variable name="count-elements">
+ <xsl:for-each select="key('named-entities', translate(@name, $uppercase-letters, $lowercase-letters))">
+ <xsl:variable name="other-name">
+ <xsl:call-template name="fully-qualified-name">
+ <xsl:with-param name="node" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$func-name = $other-name">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:value-of select="number(string-length($count-elements) = 1)"/>
</xsl:template>
<!-- Print the name of the current node -->