Mercurial > hg > Aquinas
changeset 39:13a814a86d4b
first (whole question) wrap
| author | ht |
|---|---|
| date | Tue, 15 Dec 2009 22:35:55 +0000 |
| parents | 5a1629cc1e49 |
| children | 4cf1125af332 |
| files | summa/latin/wrap.xsl |
| diffstat | 1 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/summa/latin/wrap.xsl Tue Dec 15 22:35:55 2009 +0000 @@ -0,0 +1,25 @@ +<?xml version='1.0'?> +<!DOCTYPE doc SYSTEM "../../../../lib/xml/xsl.dtd" > +<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:template match="node()|@*"> + <xsl:copy> + <xsl:apply-templates select="node()|@*"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="x:body"> + <xsl:copy> + <xsl:apply-templates select="x:a|x:div[@class='tres' or @class='uno' or @class='dos']|x:div[@class='centro'][1]"/> + <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']"> + <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]"/> + </div> + </xsl:for-each-group> + <xsl:apply-templates select="x:div[@class='centro'][2]"/> + </xsl:copy> + </xsl:template> +</xsl:stylesheet>
