]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/tools/boostbook/xsl/lookup.xsl
update sources to v12.2.3
[ceph.git] / ceph / src / boost / tools / boostbook / xsl / lookup.xsl
index 46cb7c7bb72ac3874675f74c4be70eaa37ce7540..91b4a59d44f6e012481960b9ffc3b1ca9b37cd9d 100644 (file)
   </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, '.&lt;&gt;;\:*?&quot;| ', '') != $part
         )">
         <xsl:variable name="normalized" select="translate(normalize-space(translate($part, '.&lt;&gt;;\:*?&quot;|_', '            ')), ' ', '_')"/>
+        <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 -->