Mercurial > hg > Aquinas
comparison summa/latin/wrap.xsl @ 40:4cf1125af332
working
| author | ht |
|---|---|
| date | Tue, 15 Dec 2009 22:51:58 +0000 |
| parents | 13a814a86d4b |
| children | 9dd8ca02f93c |
comparison
equal
deleted
inserted
replaced
| 39:13a814a86d4b | 40:4cf1125af332 |
|---|---|
| 1 <?xml version='1.0'?> | 1 <?xml version='1.0'?> |
| 2 <!DOCTYPE doc SYSTEM "../../../../lib/xml/xsl.dtd" > | 2 <!DOCTYPE doc SYSTEM "../../../../lib/xml/xsl.dtd" > |
| 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"> | 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"> |
| 4 <!-- Convert a Corpus Thomisticum Latin file into one with true divs, | 4 <!-- Convert a Corpus Thomisticum Latin file into one with true divs, |
| 5 replacing existing divs with h2/h3 --> | 5 replacing existing divs with h2/h3 --> |
| 6 | |
| 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"/> | |
| 6 <xsl:template match="node()|@*"> | 8 <xsl:template match="node()|@*"> |
| 7 <xsl:copy> | 9 <xsl:copy> |
| 8 <xsl:apply-templates select="node()|@*"/> | 10 <xsl:apply-templates select="node()|@*"/> |
| 9 </xsl:copy> | 11 </xsl:copy> |
| 10 </xsl:template> | 12 </xsl:template> |
| 14 <xsl:apply-templates select="x:a|x:div[@class='tres' or @class='uno' or @class='dos']|x:div[@class='centro'][1]"/> | 16 <xsl:apply-templates select="x:a|x:div[@class='tres' or @class='uno' or @class='dos']|x:div[@class='centro'][1]"/> |
| 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']"> | 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']"> |
| 16 <xsl:variable name="n" select="substring-after(.,'Quaestio ')"/> | 18 <xsl:variable name="n" select="substring-after(.,'Quaestio ')"/> |
| 17 <div class="q" id="q{$n}"> | 19 <div class="q" id="q{$n}"> |
| 18 <h2><xsl:apply-templates/></h2> | 20 <h2><xsl:apply-templates/></h2> |
| 19 <xsl:apply-templates select="current-group()[position()>1]"/> | 21 <xsl:for-each-group select="current-group()[position()>1]" group-starting-with="x:div"> |
| 22 <xsl:choose> | |
| 23 <xsl:when test="@class='G'"> | |
| 24 <div class="p"> | |
| 25 <h3><xsl:apply-templates/></h3> | |
| 26 <xsl:apply-templates select="current-group()[position()>1]"/> | |
| 27 </div> | |
| 28 </xsl:when> | |
| 29 <xsl:otherwise> | |
| 30 <div class="a"> | |
| 31 <h3><xsl:apply-templates/></h3> | |
| 32 <xsl:apply-templates select="current-group()[position()>1]"/> | |
| 33 </div> | |
| 34 </xsl:otherwise> | |
| 35 </xsl:choose> | |
| 36 </xsl:for-each-group> | |
| 37 | |
| 38 | |
| 20 </div> | 39 </div> |
| 21 </xsl:for-each-group> | 40 </xsl:for-each-group> |
| 22 <xsl:apply-templates select="x:div[@class='centro'][2]"/> | 41 <xsl:apply-templates select="x:div[@class='centro'][2]"/> |
| 23 </xsl:copy> | 42 </xsl:copy> |
| 24 </xsl:template> | 43 </xsl:template> |
