]> granicus.if.org Git - docbook-dsssl/commitdiff
Support textdata in textobject
authorNorman Walsh <ndw@nwalsh.com>
Tue, 3 Sep 2002 10:58:16 +0000 (10:58 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Tue, 3 Sep 2002 10:58:16 +0000 (10:58 +0000)
xsl/fo/graphics.xsl

index f3b073ec973532665a9f44ccac45d571bb26e715..009f5d48e093da5aec520ff153e75a1323eb4b92 100644 (file)
   <xsl:apply-templates/>
 </xsl:template>
 
+<xsl:template match="textdata">
+  <xsl:variable name="filename">
+    <xsl:choose>
+      <xsl:when test="@entityref">
+        <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@fileref"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="$use.extensions != '0'
+                    and $textinsert.extension != '0'">
+      <xsl:choose>
+        <xsl:when test="element-available('stext:insertfile')">
+          <stext:insertfile href="{$filename}"/>
+        </xsl:when>
+        <xsl:when test="element-available('xtext:insertfile')">
+          <xtext:insertfile href="{$filename}"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:message terminate="yes">
+            <xsl:text>No insertfile extension available.</xsl:text>
+          </xsl:message>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"
+         href="{$filename}"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <!-- ==================================================================== -->
 
 <xsl:template match="caption">