]> granicus.if.org Git - docbook-dsssl/commitdiff
The select.mediaobject.index template now uses the
authorBob Stayton <bobs@sagehill.net>
Wed, 18 Dec 2002 19:04:31 +0000 (19:04 +0000)
committerBob Stayton <bobs@sagehill.net>
Wed, 18 Dec 2002 19:04:31 +0000 (19:04 +0000)
$stylesheet.result.type parameter to choose the role
value, with xhtml falling back to html if needed.

xsl/common/common.xsl

index 87fe5f6ae22338ac8bc599c1c868e1646dba4fc9..8dc139cdf8cb71b688217e4390bf1415cbe4dd04 100644 (file)
@@ -870,29 +870,35 @@ recursive process.</para>
                and $olist[@role = $preferred.mediaobject.role]"> 
       
       <!-- Get the first hit's position index -->
-      <xsl:variable name="hit">
-        <xsl:for-each select="$olist">
-         <xsl:if test="@role = $preferred.mediaobject.role and
-               not(preceding-sibling::*[@role = $preferred.mediaobject.role])"> 
-            <xsl:value-of select="position()"/> 
-         </xsl:if>
-        </xsl:for-each>
-      </xsl:variable>
-      <xsl:value-of select="$hit"/>
+      <xsl:for-each select="$olist">
+        <xsl:if test="@role = $preferred.mediaobject.role and
+             not(preceding-sibling::*[@role = $preferred.mediaobject.role])"> 
+          <xsl:value-of select="position()"/> 
+        </xsl:if>
+      </xsl:for-each>
     </xsl:when>
 
     <xsl:when test="$use.role.for.mediaobject != 0 
-               and $olist[@role = 'fo']">
+               and $olist[@role = $stylesheet.result.type]">
       <!-- Get the first hit's position index -->
-      <xsl:variable name="hit">
-        <xsl:for-each select="$olist">
-         <xsl:if test="@role = 'fo' and 
-               not(preceding-sibling::*[@role = 'fo'])"> 
-            <xsl:value-of select="position()"/> 
-         </xsl:if>
-        </xsl:for-each>
-      </xsl:variable>
-      <xsl:value-of select="$hit"/>
+      <xsl:for-each select="$olist">
+        <xsl:if test="@role = $stylesheet.result.type and 
+              not(preceding-sibling::*[@role = $stylesheet.result.type])"> 
+          <xsl:value-of select="position()"/> 
+        </xsl:if>
+      </xsl:for-each>
+    </xsl:when>
+    <!-- Accept 'html' for $stylesheet.result.type = 'xhtml' -->
+    <xsl:when test="$use.role.for.mediaobject != 0 
+               and $stylesheet.result.type = 'xhtml'
+               and $olist[@role = 'html']">
+      <!-- Get the first hit's position index -->
+      <xsl:for-each select="$olist">
+        <xsl:if test="@role = 'html' and 
+              not(preceding-sibling::*[@role = 'html'])"> 
+          <xsl:value-of select="position()"/> 
+        </xsl:if>
+      </xsl:for-each>
     </xsl:when>
     <xsl:otherwise>
       <!-- Otherwise select first acceptable object -->