annotate summa/latin/wrap.xsl @ 39:13a814a86d4b

first (whole question) wrap
author ht
date Tue, 15 Dec 2009 22:35:55 +0000
parents
children 4cf1125af332
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 -->
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
6 <xsl:template match="node()|@*">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
7 <xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
8 <xsl:apply-templates select="node()|@*"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
9 </xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
10 </xsl:template>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
11
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
12 <xsl:template match="x:body">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
13 <xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
14 <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
15 <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
16 <xsl:variable name="n" select="substring-after(.,'Quaestio ')"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
17 <div class="q" id="q{$n}">
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
18 <h2><xsl:apply-templates/></h2>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
19 <xsl:apply-templates select="current-group()[position()>1]"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
20 </div>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
21 </xsl:for-each-group>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
22 <xsl:apply-templates select="x:div[@class='centro'][2]"/>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
23 </xsl:copy>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
24 </xsl:template>
13a814a86d4b first (whole question) wrap
ht
parents:
diff changeset
25 </xsl:stylesheet>