]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed bug in xml:base resolution not recursing through the ancestors.
authorBob Stayton <bobs@sagehill.net>
Thu, 9 Sep 2004 17:52:18 +0000 (17:52 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 9 Sep 2004 17:52:18 +0000 (17:52 +0000)
xsl/common/common.xsl

index c448461d1a232ffbea5ea8836fe6da91b6379db0..c3f2b05947b37ee5d646b58c2b67564ee02f887a 100644 (file)
@@ -1661,8 +1661,10 @@ node location.</para>
   <xsl:variable name="srcurl">
     <xsl:call-template name="strippath">
       <xsl:with-param name="filename">
-        <xsl:call-template name="getdir">
-          <xsl:with-param name="filename" select="$filename/ancestor-or-self::*[@xml:base != ''][1]/@xml:base"/>
+        <xsl:call-template name="xml.base.dirs">
+          <xsl:with-param name="base.elem" 
+                          select="$filename/ancestor-or-self::*
+                                   [@xml:base != ''][1]"/>
         </xsl:call-template>
         <xsl:value-of select="$filename"/>
       </xsl:with-param>
@@ -1701,6 +1703,24 @@ node location.</para>
 
 <!-- ===================================== -->
 
+<xsl:template name="xml.base.dirs">
+  <xsl:param name="base.elem" select="NONODE"/>
+
+  <!-- Recursively resolve xml:base attributes -->
+  <xsl:if test="$base.elem/ancestor::*[@xml:base != '']">
+    <xsl:call-template name="xml.base.dirs">
+      <xsl:with-param name="base.elem" 
+                      select="$base.elem/ancestor::*[@xml:base != ''][1]"/>
+    </xsl:call-template>
+  </xsl:if>
+  <xsl:call-template name="getdir">
+    <xsl:with-param name="filename" select="$base.elem/@xml:base"/>
+  </xsl:call-template>
+
+</xsl:template>
+
+<!-- ===================================== -->
+
 <xsl:template name="strippath">
   <xsl:param name="filename" select="''"/>
   <xsl:choose>