]> granicus.if.org Git - docbook-dsssl/commitdiff
parameterise choice of image filename
authorSteve Ball <balls@users.sourceforge.net>
Mon, 14 Jul 2008 08:51:10 +0000 (08:51 +0000)
committerSteve Ball <balls@users.sourceforge.net>
Mon, 14 Jul 2008 08:51:10 +0000 (08:51 +0000)
xsl/roundtrip/wordml2normalise.xsl

index a6acca80e909e87dfa59b098f51b74f2008c9c9d..d00b34983f48b56637257b05551c1ab50813d59a 100644 (file)
       <xsl:when test='w:rPr/w:rStyle/@w:val = "CommentReference"'/>
       <xsl:when test='w:pict'>
         <xsl:variable name='filename'>
-          <xsl:choose>
-            <xsl:when test='contains(w:pict/w:binData/@w:name, "wordml://")'>
-              <xsl:value-of select='substring-after(w:pict/w:binData/@w:name, "wordml://")'/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:text>image</xsl:text>
-              <xsl:value-of select='count(preceding::w:pict) + 1'/>
-              <xsl:text>.jpg</xsl:text>
-            </xsl:otherwise>
-          </xsl:choose>
+          <xsl:call-template name='rnd:image-filename'/>
         </xsl:variable>
 
         <xsl:call-template name='rnd:handle-image-data'>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
-  <!-- An application may wish to override this template -->
+  <!-- An application may wish to override these templates -->
+  <xsl:template name='rnd:image-filename'>
+    <xsl:param name='pict' select='w:pict'/>
+
+    <xsl:choose>
+      <xsl:when test='contains($pict/w:binData/@w:name, "wordml://")'>
+        <xsl:value-of select='substring-after($pict/w:binData/@w:name, "wordml://")'/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>image</xsl:text>
+        <xsl:value-of select='count($pict/preceding::w:pict) + 1'/>
+        <xsl:text>.jpg</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
   <xsl:template name='rnd:handle-image-data'>
     <xsl:param name='filename'/>
     <xsl:param name='data'/>