changeset 52:f02dd65775b6

working
author ht
date Sun, 27 Dec 2009 22:45:01 +0000
parents 665e992a0226
children d777cc3962f2
files summa/english/split.xsl
diffstat 1 files changed, 46 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/summa/english/split.xsl	Sun Dec 27 22:45:01 2009 +0000
@@ -0,0 +1,46 @@
+<?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:xi="http://www.w3.org/2001/XInclude" xmlns:x="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="x">
+ 
+ <xsl:output method="xhtml" indent="no"/>
+ 
+ <xsl:template match="x:body">
+  <xsl:variable name="pre" select="x:a[@href='summa.FP_Q1.html'][1]"/>
+  <xsl:copy>
+   <xsl:apply-templates select="@*"/>
+   <xsl:for-each select="$pre">
+   <xsl:apply-templates select="preceding-sibling::*"/>
+   <xsl:apply-templates select="."/>
+   <xsl:for-each-group select="following-sibling::*" group-starting-with="x:h1[@id='viii-p0.1']">
+    <xsl:choose>
+     <xsl:when test="position()=1">
+      <xsl:for-each-group select="current-group()" group-starting-with="x:h2">       <xsl:variable name="name" select="translate(substring-before(./@id,'-'),'.','_')"/>
+    <xsl:message>f: <xsl:value-of select="$name"/>|<xsl:value-of select="local-name()"/>|<xsl:value-of select="count(current-group())"/></xsl:message>
+<xsl:text>&#10;</xsl:text>
+    <xi:include href="{$name}.html"/>
+    <xsl:result-document method="xhtml" href="{$name}.html">
+     <div><xsl:apply-templates select="current-group()" mode="subdoc"/></div>
+    </xsl:result-document>
+      </xsl:for-each-group>
+<xsl:text>&#10;</xsl:text>
+     </xsl:when>
+     <xsl:otherwise>
+      <xsl:apply-templates select="current-group()"/>
+     </xsl:otherwise>
+    </xsl:choose>    
+   </xsl:for-each-group>
+  </xsl:for-each></xsl:copy>
+ </xsl:template>
+ 
+ <xsl:template match="node()|@*">
+  <xsl:copy>
+   <xsl:apply-templates select="node()|@*"/>
+  </xsl:copy>
+ </xsl:template>
+ 
+ <xsl:template match="node()|@*" mode="subdoc">
+  <xsl:copy>
+   <xsl:apply-templates select="node()|@*"/>
+  </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>