changeset 40:4cf1125af332

working
author ht
date Tue, 15 Dec 2009 22:51:58 +0000
parents 13a814a86d4b
children 9dd8ca02f93c
files summa/latin/wrap.xsl
diffstat 1 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/summa/latin/wrap.xsl	Tue Dec 15 22:35:55 2009 +0000
+++ b/summa/latin/wrap.xsl	Tue Dec 15 22:51:58 2009 +0000
@@ -3,6 +3,8 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:x="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="x">
  <!-- Convert a Corpus Thomisticum Latin file into one with true divs,
        replacing existing divs with h2/h3 -->
+ 
+ <xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="file:///c:/cygwin/usr/local/share/lib/xml/xhtml1-transitional.dtd"/>
  <xsl:template match="node()|@*">
   <xsl:copy>
    <xsl:apply-templates select="node()|@*"/>
@@ -16,7 +18,24 @@
    <xsl:variable name="n" select="substring-after(.,'Quaestio ')"/>
   <div class="q" id="q{$n}">
    <h2><xsl:apply-templates/></h2>
-    <xsl:apply-templates select="current-group()[position()>1]"/>   
+   <xsl:for-each-group select="current-group()[position()>1]" group-starting-with="x:div">
+    <xsl:choose>
+     <xsl:when test="@class='G'">
+      <div class="p">
+       <h3><xsl:apply-templates/></h3>
+       <xsl:apply-templates select="current-group()[position()>1]"/>
+      </div>
+     </xsl:when>
+     <xsl:otherwise>
+      <div class="a">
+       <h3><xsl:apply-templates/></h3>
+       <xsl:apply-templates select="current-group()[position()>1]"/>
+      </div>
+     </xsl:otherwise>
+    </xsl:choose>
+   </xsl:for-each-group>
+   
+       
   </div>
   </xsl:for-each-group>
    <xsl:apply-templates select="x:div[@class='centro'][2]"/>