]> granicus.if.org Git - docbook-dsssl/commitdiff
Use mediaobject.filename to calculate graphic reference
authorNorman Walsh <ndw@nwalsh.com>
Wed, 1 Aug 2001 08:51:25 +0000 (08:51 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 1 Aug 2001 08:51:25 +0000 (08:51 +0000)
xsl/fo/graphics.xsl

index 1a1b7fdb8de101ad9f1ce3796958526bba89a060..9c09230b64a9ade89821bf47a6aa274ef1f61217 100644 (file)
@@ -75,41 +75,20 @@ FIXME: make is.graphic.* work correctly depending on the backend!
   <!-- a graphic, inlinegraphic, imagedata, or videodata. All    -->
   <!-- those elements have the same set of attributes, so we can -->
   <!-- handle them all in one place.                             -->
-  <xsl:variable name="input-filename">
-    <xsl:choose>
-      <xsl:when test="@entityref">
-        <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
-      </xsl:when>
-      <xsl:when test="@fileref">
-        <xsl:value-of select="@fileref"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:message>
-          <xsl:text>Expected @entityref or @fileref on </xsl:text>
-          <xsl:value-of select="name(.)"/>
-        </xsl:message>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-
-  <xsl:variable name="fileext">
-    <xsl:call-template name="filename-extension">
-      <xsl:with-param name="filename" select="$input-filename"/>
-    </xsl:call-template>
-  </xsl:variable>
-
   <xsl:variable name="filename">
     <xsl:choose>
-      <xsl:when test="$fileext != ''">
-        <xsl:value-of select="$input-filename"/>
-      </xsl:when>
-      <xsl:when test="$graphic.default.extension != ''">
-        <xsl:value-of select="$input-filename"/>
-        <xsl:text>.</xsl:text>
-        <xsl:value-of select="$graphic.default.extension"/>
+      <xsl:when test="local-name(.) = 'graphic'
+                      or local-name(.) = 'inlinegraphic'">
+        <!-- handle legacy graphic and inlinegraphic by new template --> 
+        <xsl:call-template name="mediaobject.filename">
+          <xsl:with-param name="object" select="."/>
+        </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
-        <xsl:value-of select="$input-filename"/>
+        <!-- imagedata, videodata, audiodata -->
+        <xsl:call-template name="mediaobject.filename">
+          <xsl:with-param name="object" select=".."/>
+        </xsl:call-template>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>