library-web r397 - in trunk: . data/xslt



Author: fpeters
Date: Sun Mar  2 12:20:03 2008
New Revision: 397
URL: http://svn.gnome.org/viewvc/library-web?rev=397&view=rev

Log:
* data/xslt/db2html.xsl: copied db.xref.target and modified it as not
to have the filename in links to local anchor.



Modified:
   trunk/ChangeLog
   trunk/data/xslt/db2html.xsl

Modified: trunk/data/xslt/db2html.xsl
==============================================================================
--- trunk/data/xslt/db2html.xsl	(original)
+++ trunk/data/xslt/db2html.xsl	Sun Mar  2 12:20:03 2008
@@ -237,5 +237,41 @@
   </xsl:choose>
 </xsl:template>
 
+<!-- modified from common/db-xref.xsl to avoid filename in link when generating
+     a flat file-->
+<xsl:template name="db.xref.target">
+  <xsl:param name="linkend" select="@linkend"/>
+  <xsl:param name="target" select="key('idkey', $linkend)"/>
+  <xsl:param name="is_chunk" select="false()"/>
+  <xsl:choose>
+    <xsl:when test="$linkend = $db.chunk.info_basename">
+      <xsl:value-of
+       select="concat($db.chunk.info_basename, $db.chunk.extension)"/>
+    </xsl:when>
+    <xsl:when test="set:has-same-node($target, /*)">
+      <xsl:value-of select="concat($db.chunk.basename, $db.chunk.extension)"/>
+    </xsl:when>
+    <xsl:when test="$is_chunk">
+      <xsl:value-of select="concat($linkend, $db.chunk.extension)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name="target_chunk_id">
+        <xsl:call-template name="db.chunk.chunk-id">
+          <xsl:with-param name="node" select="$target"/>
+        </xsl:call-template>
+      </xsl:variable>
+      <!-- NOTE: this is the difference with standard db.xref.target -->
+      <xsl:if test="$db.chunk.max_depth != 0 or $target_chunk_id != 'index'">
+        <xsl:value-of select="concat($target_chunk_id, $db.chunk.extension)"/>
+      </xsl:if>
+      <xsl:if test="string($linkend) != '' and string($target_chunk_id) != string($linkend)">
+        <xsl:value-of select="concat('#', $linkend)"/>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
+
 
 </xsl:stylesheet>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]