forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r312885 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.Daisy/resources/stylesheets/daisy2html.xsl
Date Tue, 11 Oct 2005 13:57:58 GMT
Author: rgardler
Date: Tue Oct 11 06:57:51 2005
New Revision: 312885

URL: http://svn.apache.org/viewcvs?rev=312885&view=rev
Log:
use daisy 1.3 XML schema

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=312885&r1=312884&r2=312885&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 Oct 11 06:57:51 2005
@@ -23,6 +23,7 @@
     version="1.0">
       
   <xsl:template match="/">
+    <xsl:variable name="rootElementName"><xsl:value-of select="name(*)"/></xsl:variable>
     <html>
       <head>
         <xsl:choose>
@@ -30,8 +31,8 @@
             <title><xsl:value-of select="//ns:document/@name"/></title>
             <xsl:apply-templates select="//p:preparedDocument/ns:document/ns:fields/ns:field"/>
           </xsl:when>
-          <xsl:when test="html">
-            <title>FIXME: get the title of the document</title>
+          <xsl:when test="$rootElementName = 'html'">
+            <title><xsl:value-of select="html/head/title"/></title>
           </xsl:when>
           <xsl:otherwise>
             <title>Daisy Error</title>
@@ -40,15 +41,15 @@
       </head>
       <body>
         <xsl:choose>
-          <xsl:when test="p:page">
-            <xsl:apply-templates select="p:page/p:publishedDocument/p:preparedDocument[@id='1']"/>
+          <xsl:when test="$rootElementName = 'p:publisherResponse'">
+            <xsl:apply-templates select="p:publisherResponse/p:document/p:preparedDocuments/p:preparedDocument[@id='1']"/>
           </xsl:when>
-          <xsl:when test="html">
+          <xsl:when test="$rootElementName = 'html'">
             <xsl:apply-templates select="//body"/>
           </xsl:when>
           <xsl:otherwise>
             <h1>Daisy Error</h1>
-            <p>Unable to transform the daisy document.</p>
+            <p>Unable to transform the daisy document with root element of <xsl:value-of
select="$rootElementName"/>.</p>
           </xsl:otherwise>
         </xsl:choose>
       </body>



Mime
View raw message