changeset 42:8f4be7dfda7a

ready to try real work
author ht
date Wed, 16 Dec 2009 23:11:44 +0000
parents 9dd8ca02f93c
children d49f2ca9374c
files summa/bilingual/merge.xsl
diffstat 1 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/summa/bilingual/merge.xsl	Wed Dec 16 23:11:44 2009 +0000
@@ -0,0 +1,26 @@
+<?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" exclude-result-prefixes="x" xmlns:x="http://www.w3.org/1999/xhtml">
+ 
+ <!-- Merge wrapped latin and prepped english to produce two-column
+      bilingual for a single Summa Question -->
+ <xsl:param name="lf">xyzzy</xsl:param>
+ <xsl:variable name="latin" select="document($lf,/)/*"/>
+ <xsl:key name="lq" match="x:div[@class='q']" use="@id"/>
+ <xsl:variable name="di" select="/x:div/@id"/>
+ <xsl:variable name="qi" select="concat('q',substring-after($di,'_Q'))"/>
+ <xsl:variable name="la" select="key('lq',$qi,$latin)"/>
+
+ <xsl:template match="node()|@*">
+  <xsl:copy>
+   <xsl:apply-templates select="node()|@*"/>
+  </xsl:copy>
+ </xsl:template>
+ 
+ <xsl:template match="x:div/x:div[@n]">
+  <!-- Wraps a single article within a question -->
+  <xsl:variable name="n" select="count(preceding-sibling::x:div[@n])+1"/>
+  <xsl:variable name="ld" select="$la/x:div[@class='a'][position()=$n]"/>
+  <xsl:message><xsl:value-of select="@n"/>,<xsl:value-of select="$n"/>,<xsl:value-of select="@title"/>,<xsl:value-of select="count(x:div)"/>,<xsl:value-of select="$ld/x:h3"/>,<xsl:value-of select="count($ld/x:p)"/></xsl:message>
+ </xsl:template>
+</xsl:stylesheet>