]> granicus.if.org Git - docbook-dsssl/commitdiff
When we are chunking long descriptions for mediaobject instances
authorMichael Smith <xmldoc@users.sourceforge.net>
Sun, 1 Jul 2007 08:31:52 +0000 (08:31 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sun, 1 Jul 2007 08:31:52 +0000 (08:31 +0000)
into separate HTML output files, and use.id.as.filename is
non-zero, if a mediaobject has an ID, use that ID as the basename
for the long-description file (otherwise, we generate an ID for it
and use that ID as the basename for the file).
The parallels the recent change made to cause IDs for legalnotice
instances to be used as basenames for legalnotice chunks.
Also, made some minor refinements to the recent changes for
legalnotice chunk handling.

xsl/html/chunk-code.xsl
xsl/html/graphics.xsl

index 39ee812bc2d583279fe0ec8c554c02f28a14e2a6..57e4d8cc8262edf1914cd54876730a6936a1b879 100644 (file)
@@ -82,9 +82,9 @@
         <xsl:value-of select="$html.ext"/>
       </xsl:when>
       <!-- Special case -->
-      <xsl:when test="self::legalnotice and $generate.legalnotice.link != 0">
+      <xsl:when test="self::legalnotice and not($generate.legalnotice.link = 0)">
         <xsl:choose>
-          <xsl:when test="(@id or @xml:id) and $use.id.as.filename != 0">
+          <xsl:when test="(@id or @xml:id) and not($use.id.as.filename = 0)">
             <!-- * if this legalnotice has an ID, then go ahead and use -->
             <!-- * just the value of that ID as the basename for the file -->
             <!-- * (that is, without prepending an "ln-" too it) -->
@@ -93,7 +93,7 @@
           </xsl:when>
           <xsl:otherwise>
             <!-- * otherwise, if this legalnotice does not have an ID, -->
-            <!-- * then we generate one an ID... -->
+            <!-- * then we generate an ID... -->
             <xsl:variable name="id">
               <xsl:call-template name="object.id"/>
             </xsl:variable>
index 5a22a60b40fbfee0af4419ece51bb1b981feea0e..1254998764548b7ceb7216ddf8471e334d5684b1 100644 (file)
@@ -1224,14 +1224,8 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
 
 <xsl:template name="longdesc.uri">
   <xsl:param name="mediaobject" select="."/>
-
   <xsl:if test="$html.longdesc">
     <xsl:if test="$mediaobject/textobject[not(phrase)]">
-      <xsl:variable name="image-id">
-        <xsl:call-template name="object.id">
-          <xsl:with-param name="object" select="$mediaobject"/>
-        </xsl:call-template>
-      </xsl:variable>
       <xsl:variable name="dbhtml.dir">
         <xsl:call-template name="dbhtml-dir"/>
       </xsl:variable>
@@ -1247,8 +1241,31 @@ valign: <xsl:value-of select="@valign"/></xsl:message>
               </xsl:otherwise>
             </xsl:choose>
           </xsl:with-param>
-          <xsl:with-param name="base.name"
-                          select="concat('ld-',$image-id,$html.ext)"/>
+          <xsl:with-param name="base.name">
+            <xsl:choose>
+              <xsl:when test="
+                $mediaobject/@*[local-name() = 'id']
+                and not($use.id.as.filename = 0)">
+                <!-- * if this mediaobject has an ID, then we use the -->
+                <!-- * value of that ID as basename for the "longdesc" -->
+                <!-- * file (that is, without prepending an "ld-" too it) -->
+                <xsl:value-of select="$mediaobject/@*[local-name() = 'id']"/>
+                <xsl:value-of select="$html.ext"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <!-- * otherwise, if this mediaobject does not have an -->
+                <!-- * ID, then we generate an ID... -->
+                <xsl:variable name="image-id">
+                  <xsl:call-template name="object.id">
+                    <xsl:with-param name="object" select="$mediaobject"/>
+                  </xsl:call-template>
+                </xsl:variable>
+                <!-- * ...and then we take that generated ID, prepend an -->
+                <!-- * "ld-" to it, and use that as the basename for the file -->
+                <xsl:value-of select="concat('ld-',$image-id,$html.ext)"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:with-param>
         </xsl:call-template>
       </xsl:variable>