annotate summa/latin/wrap.xsl @ 40:4cf1125af332

working
author ht
date Tue, 15 Dec 2009 22:51:58 +0000
parents 13a814a86d4b
children 9dd8ca02f93c
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 ')"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
19 <div class="q" id="q{$n}">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
20 <h2><xsl:apply-templates/></h2>
40
4cf1125af332 working
ht
parents: 39
diff changeset
21 <xsl:for-each-group select="current-group()[position()>1]" group-starting-with="x:div">
4cf1125af332 working
ht
parents: 39
diff changeset
22 <xsl:choose>
4cf1125af332 working
ht
parents: 39
diff changeset
23 <xsl:when test="@class='G'">
4cf1125af332 working
ht
parents: 39
diff changeset
24 <div class="p">
4cf1125af332 working
ht
parents: 39
diff changeset
25 <h3><xsl:apply-templates/></h3>
4cf1125af332 working
ht
parents: 39
diff changeset
26 <xsl:apply-templates select="current-group()[position()>1]"/>
4cf1125af332 working
ht
parents: 39
diff changeset
27 </div>
4cf1125af332 working
ht
parents: 39
diff changeset
28 </xsl:when>
4cf1125af332 working
ht
parents: 39
diff changeset
29 <xsl:otherwise>
4cf1125af332 working
ht
parents: 39
diff changeset
30 <div class="a">
4cf1125af332 working
ht
parents: 39
diff changeset
31 <h3><xsl:apply-templates/></h3>
4cf1125af332 working
ht
parents: 39
diff changeset
32 <xsl:apply-templates select="current-group()[position()>1]"/>
4cf1125af332 working
ht
parents: 39
diff changeset
33 </div>
4cf1125af332 working
ht
parents: 39
diff changeset
34 </xsl:otherwise>
4cf1125af332 working
ht
parents: 39
diff changeset
35 </xsl:choose>
4cf1125af332 working
ht
parents: 39
diff changeset
36 </xsl:for-each-group>
4cf1125af332 working
ht
parents: 39
diff changeset
37
4cf1125af332 working
ht
parents: 39
diff changeset
38
39
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
39 </div>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
40 </xsl:for-each-group>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
41 <xsl:apply-templates select="x:div[@class='centro'][2]"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
42 </xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
43 </xsl:template>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
44 </xsl:stylesheet>