forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r233095 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/daisy2html.xsl
Date Wed, 17 Aug 2005 00:58:50 GMT
Author: rgardler
Date: Tue Aug 16 17:58:45 2005
New Revision: 233095

URL: http://svn.apache.org/viewcvs?rev=233095&view=rev
Log:
handle daisy: urls with an anchor

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/daisy2html.xsl

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/daisy2html.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/daisy2html.xsl?rev=233095&r1=233094&r2=233095&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/daisy2html.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/daisy2html.xsl
Tue Aug 16 17:58:45 2005
@@ -156,7 +156,17 @@
     <xsl:choose>
       <xsl:when test="starts-with(@href, 'daisy:')">
         <a>
-          <xsl:attribute name="href"><xsl:value-of select="substring-after(@href,
'daisy:')"/>.daisy.html</xsl:attribute>
+          <xsl:variable name="url"><xsl:value-of select="substring-after(@href,
'daisy:')"/></xsl:variable>
+          <xsl:choose>
+            <xsl:when test="contains($url, '#')">
+              <xsl:variable name="pageURL"><xsl:value-of select="substring-before($url,
'#')"/></xsl:variable>
+              <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,
'#')"/></xsl:variable>
+              <xsl:attribute name="href"><xsl:value-of select="$pageURL"/>.daisy.html#<xsl:value-of
select="$anchor"/></xsl:attribute>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:attribute name="href"><xsl:value-of select="$url"/>.daisy.html</xsl:attribute>
+            </xsl:otherwise>
+          </xsl:choose>
           <xsl:attribute name="description"><xsl:value-of select="@daisyDocumentName"/></xsl:attribute>
           <xsl:apply-templates/>
         </a>



Mime
View raw message