]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed olink database access for Saxon and DB5.
authorBob Stayton <bobs@sagehill.net>
Mon, 9 Oct 2006 06:26:05 +0000 (06:26 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 9 Oct 2006 06:26:05 +0000 (06:26 +0000)
xsl/common/olink.xsl

index 2c12e9db1b95da410e0d9e1a101dc597e8110def..6bd2d43004b12a2fb638176040102c6da459dcaa 100644 (file)
   <xsl:param name="targetptr.att" select="''"/>
   <xsl:param name="olink.lang" select="''"/>
 
+  <!-- use root's xml:base if exists -->
+  <xsl:variable name="xml.base" select="/*/@xml:base"/>
+
   <!-- This selection can be customized if needed -->
-  <xsl:variable name="target.database.filename" 
-      select="$target.database.document"/>
+  <xsl:variable name="target.database.filename">
+    <xsl:choose>
+      <xsl:when test="$xml.base != '' and
+                   not(starts-with($target.database.document, 'file:/')) and
+                   not(starts-with($target.database.document, '/'))">
+        <xsl:call-template name="systemIdToBaseURI">
+          <xsl:with-param name="systemId" select="$xml.base"/>
+        </xsl:call-template>
+        <xsl:value-of select="$target.database.document"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$target.database.document"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
 
   <xsl:variable name="target.database" 
       select="document($target.database.filename,/)"/>