]> granicus.if.org Git - docbook-dsssl/commitdiff
Added comment about possible hacking to deal with graphic relative URI issue
authorNorman Walsh <ndw@nwalsh.com>
Fri, 21 Apr 2006 16:12:15 +0000 (16:12 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 21 Apr 2006 16:12:15 +0000 (16:12 +0000)
xsl/html/graphics.xsl

index 48d6b640d3acc2daaebc6ebf7bfd1135d1867e7a..8e6a3259f15eaff63cc27bafa3470a4745fbbcc1 100644 (file)
   <xsl:variable name="output_filename">
     <xsl:choose>
       <xsl:when test="@entityref">
-        <xsl:value-of select="$filename"/>
+       <xsl:value-of select="$filename"/>
       </xsl:when>
       <xsl:when test="$keep.relative.image.uris != 0">
-       <xsl:value-of select="@fileref"/>
+       <!-- This works sometimes, but needs to take into account
+             1. When there is no /*/@xml:base
+             2. When the chunks are going somewhere else
+       <xsl:variable name="relpath">
+         <xsl:call-template name="relative-uri">
+           <xsl:with-param name="filename" select="@fileref"/>
+         </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:choose>
+         <xsl:when test="/*/@xml:base
+                         and starts-with($relpath,/*/@xml:base)">
+           <xsl:value-of select="substring-after($relpath,/*/@xml:base)"/>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:value-of select="@fileref"/>
+         </xsl:otherwise>
+       </xsl:choose>
+       -->
+       <xsl:value-of select="@fileref"/>
       </xsl:when>
       <xsl:otherwise>
-        <xsl:value-of select="$filename"/>
+       <xsl:value-of select="$filename"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>