annotate summa/latin/wrap.xsl @ 89:ca573ccfc3e7

fix some missing headers, etc.
author ht
date Sun, 16 Jun 2013 14:43:49 +0000
parents 9dd8ca02f93c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
39
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
1 <?xml version='1.0'?>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
2 <!DOCTYPE doc SYSTEM "../../../../lib/xml/xsl.dtd" >
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
3 <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">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
4 <!-- Convert a Corpus Thomisticum Latin file into one with true divs,
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
5 replacing existing divs with h2/h3 -->
40
4cf1125af332 working
ht
parents: 39
diff changeset
6
4cf1125af332 working
ht
parents: 39
diff changeset
7 <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"/>
39
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
8 <xsl:template match="node()|@*">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
9 <xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
10 <xsl:apply-templates select="node()|@*"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
11 </xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
12 </xsl:template>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
13
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
14 <xsl:template match="x:body">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
15 <xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
16 <xsl:apply-templates select="x:a|x:div[@class='tres' or @class='uno' or @class='dos']|x:div[@class='centro'][1]"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
17 <xsl:for-each-group select="x:p|x:div[not(@class='tres' or @class='uno' or @class='dos' or @class='centro')]" group-starting-with="x:div[@class='D']">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
18 <xsl:variable name="n" select="substring-after(.,'Quaestio ')"/>
41
9dd8ca02f93c add progress messages
ht
parents: 40
diff changeset
19 <xsl:message><xsl:if test="position()=1"><xsl:text> </xsl:text><xsl:value-of select="last()"/><xsl:text> questions:
9dd8ca02f93c add progress messages
ht
parents: 40
diff changeset
20 </xsl:text></xsl:if><xsl:text> Question </xsl:text><xsl:value-of select="$n"/></xsl:message>
39
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
21 <div class="q" id="q{$n}">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
22 <h2><xsl:apply-templates/></h2>
40
4cf1125af332 working
ht
parents: 39
diff changeset
23 <xsl:for-each-group select="current-group()[position()>1]" group-starting-with="x:div">
4cf1125af332 working
ht
parents: 39
diff changeset
24 <xsl:choose>
4cf1125af332 working
ht
parents: 39
diff changeset
25 <xsl:when test="@class='G'">
4cf1125af332 working
ht
parents: 39
diff changeset
26 <div class="p">
4cf1125af332 working
ht
parents: 39
diff changeset
27 <h3><xsl:apply-templates/></h3>
4cf1125af332 working
ht
parents: 39
diff changeset
28 <xsl:apply-templates select="current-group()[position()>1]"/>
4cf1125af332 working
ht
parents: 39
diff changeset
29 </div>
4cf1125af332 working
ht
parents: 39
diff changeset
30 </xsl:when>
4cf1125af332 working
ht
parents: 39
diff changeset
31 <xsl:otherwise>
4cf1125af332 working
ht
parents: 39
diff changeset
32 <div class="a">
4cf1125af332 working
ht
parents: 39
diff changeset
33 <h3><xsl:apply-templates/></h3>
4cf1125af332 working
ht
parents: 39
diff changeset
34 <xsl:apply-templates select="current-group()[position()>1]"/>
4cf1125af332 working
ht
parents: 39
diff changeset
35 </div>
4cf1125af332 working
ht
parents: 39
diff changeset
36 </xsl:otherwise>
4cf1125af332 working
ht
parents: 39
diff changeset
37 </xsl:choose>
4cf1125af332 working
ht
parents: 39
diff changeset
38 </xsl:for-each-group>
4cf1125af332 working
ht
parents: 39
diff changeset
39
4cf1125af332 working
ht
parents: 39
diff changeset
40
39
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
41 </div>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
42 </xsl:for-each-group>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
43 <xsl:apply-templates select="x:div[@class='centro'][2]"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
44 </xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
45 </xsl:template>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
46 </xsl:stylesheet>