[yelp-xsl] dita-ref: Handle local URLs, sort of



commit bc710666ba5b471d48511e38c1fd1048772f1843
Author: Shaun McCance <shaunm gnome org>
Date:   Mon Oct 8 10:19:22 2012 -0400

    dita-ref: Handle local URLs, sort of

 xslt/dita/common/dita-ref.xsl |   23 ++++++++++++++++++++++-
 xslt/dita/html/dita2xhtml.xsl |   22 ++--------------------
 2 files changed, 24 insertions(+), 21 deletions(-)
---
diff --git a/xslt/dita/common/dita-ref.xsl b/xslt/dita/common/dita-ref.xsl
index e054446..3b1d605 100644
--- a/xslt/dita/common/dita-ref.xsl
+++ b/xslt/dita/common/dita-ref.xsl
@@ -34,6 +34,19 @@ DITA References
 REMARK: Describe this module
 -->
 
+
+<!--@@==========================================================================
+dita.ref.extension
+The filename extension for output files.
+:Revision:version="3.8" date="2012-10-08" status="final"
+
+When link targets are constructed by *{dita.ref.href.target.custom} from #{href}
+attributes, this string is appended. This is used to specify the file extension
+when creating output files from DITA topics.
+-->
+<xsl:param name="dita.ref.extension"/>
+
+
 <xsl:key name="dita.id.key" match="&topic_topic_all;[ id]" use="@id"/>
 <xsl:key name="dita.id.key" match="*[ id][not(self::&topic_topic_all;)]"
          use="concat(ancestor-or-self::&topic_topic_all;[1]/@id, '/', @id)"/>
@@ -156,7 +169,15 @@ REMARK: Describe this module
         </xsl:if>
       </xsl:variable>
       <xsl:if test="$uri != ''">
-        <xsl:text>FIXME</xsl:text>
+        <xsl:choose>
+          <xsl:when test="substring($uri, string-length($uri) - 4) = '.dita'">
+            <xsl:value-of select="substring($uri, 1, string-length($uri) - 5)"/>
+          </xsl:when>
+          <xsl:when test="substring($uri, string-length($uri) - 3) = '.xml'">
+            <xsl:value-of select="substring($uri, 1, string-length($uri) - 4)"/>
+          </xsl:when>
+        </xsl:choose>
+        <xsl:value-of select="$dita.ref.extension"/>
       </xsl:if>
       <xsl:if test="$frag != ''">
         <xsl:text>#</xsl:text>
diff --git a/xslt/dita/html/dita2xhtml.xsl b/xslt/dita/html/dita2xhtml.xsl
index 0170604..956a68c 100644
--- a/xslt/dita/html/dita2xhtml.xsl
+++ b/xslt/dita/html/dita2xhtml.xsl
@@ -34,27 +34,9 @@ REMARK: Describe this module
 <xsl:import href="../../common/ttml.xsl"/>
 <xsl:import href="../../common/utils.xsl"/>
 
-<xsl:include href="../common/dita-ref.xsl"/>
+<xsl:import href="../common/dita-ref.xsl"/>
 
-<!--
-<xsl:param name="mal.if.target" select="'target:html target:xhtml'"/>
-<xsl:param name="mal.if.features" select="'
-mallard:1.0
-'"/>
-<xsl:param name="mal.if.maybe" select="'target:mobile'"/>
-<xsl:param name="mal.link.extension" select="$html.extension"/>
-<xsl:param name="ttml.features" select="'
-http://www.w3.org/ns/ttml/feature/#content
-http://www.w3.org/ns/ttml/feature/#core
-http://www.w3.org/ns/ttml/feature/#nested-div
-http://www.w3.org/ns/ttml/feature/#nested-span
-http://www.w3.org/ns/ttml/feature/#presentation
-http://www.w3.org/ns/ttml/feature/#profile
-http://www.w3.org/ns/ttml/feature/#structure
-http://www.w3.org/ns/ttml/feature/#time-offset
-http://www.w3.org/ns/ttml/feature/#timing
-'"/>
--->
+<xsl:param name="dita.ref.extension" select="$html.extension"/>
 
 <xsl:include href="dita2html-block.xsl"/>
 <xsl:include href="dita2html-inline.xsl"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]