story_print.xsl
branchstyles
changeset 0 08de8d15f932
child 4 301b54644bfa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/story_print.xsl	Tue Dec 27 13:55:27 2005 -0500
@@ -0,0 +1,186 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.1"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xt="http://www.jclark.com/xt"
+  extension-element-prefixes="xt" 
+  xmlns="http://www.w3.org/1999/XSL/Format">
+
+<xsl:import href="common.xsl"/>
+<xsl:import href="print.xsl"/>
+<xsl:import href="masters_print.xsl"/>
+
+<xsl:output method="xml" indent="yes"/>
+
+<xsl:attribute-set name="standard-block">
+  <xsl:attribute name="text-indent">10mm</xsl:attribute>
+  <xsl:attribute name="space-before">10pt</xsl:attribute>
+  <xsl:attribute name="space-before.conditionnaly">discard</xsl:attribute>
+  <xsl:attribute name="text-align">justify</xsl:attribute>
+</xsl:attribute-set>
+
+<xsl:template name="static-content">
+  <xsl:param name="title"/>
+  <static-content flow-name="xsl-region-before">
+    <block border-after-style="solid">
+      <table width="100%" table-layout="fixed">
+            <table-column column-width="proportional-column-width(1)"
+                  number-columns-repeated="2"/>
+            <table-body>
+              <table-row>
+                <table-cell>
+                  <block text-align="start"><xsl:value-of select="$title"/></block>
+                </table-cell>
+              </table-row>
+            </table-body>
+          </table>
+        </block>
+      </static-content>
+      <static-content flow-name="xsl-region-after">
+        <block border-before-style="solid">
+          <table width="100%" table-layout="fixed">
+            <table-column column-width="proportional-column-width(1)"
+                  number-columns-repeated="2"/>
+            <table-body>
+              <table-row>
+                <table-cell>
+                  <block text-align="end">
+		    <xsl:text>page </xsl:text>
+                    <page-number/>
+                  </block>
+                </table-cell>
+              </table-row>
+            </table-body>
+          </table>
+        </block>
+      </static-content>
+</xsl:template>
+
+<!-- book -->
+<xsl:template match="book">
+  <root>
+    <xsl:call-template name="master-set"/>
+    <xsl:apply-templates select="section"/>
+  </root>
+</xsl:template>
+
+<xsl:template match="/book/section">
+  <page-sequence master-reference="book-sequence">
+    <xsl:call-template name="static-content">
+      <xsl:with-param name="title">
+        <xsl:apply-templates select="title"/>
+      </xsl:with-param>
+    </xsl:call-template>
+    <flow flow-name="xsl-region-body">
+      <xsl:apply-templates select="*[name()!='story']"/>
+    </flow>
+  </page-sequence>
+  <xsl:apply-templates select="story"/> 
+</xsl:template>
+
+<xsl:template match="story">
+  <page-sequence master-reference="book-sequence">
+    <xsl:call-template name="static-content">
+      <xsl:with-param name="title">
+        <xsl:apply-templates select="title"/>
+      </xsl:with-param>
+    </xsl:call-template>
+    <flow flow-name="xsl-region-body">
+      <xsl:apply-templates/>
+    </flow>
+  </page-sequence>
+</xsl:template>
+
+<xsl:template match="section/title">
+  <block xsl:use-attribute-sets="verylarge-title-font">
+    <xsl:attribute name="space-after">5pt</xsl:attribute>
+    <xsl:attribute name="space-before">10pt</xsl:attribute>
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+
+<xsl:template match="story/title">
+  <block xsl:use-attribute-sets="large-title-font">
+    <xsl:attribute name="space-after">5pt</xsl:attribute>
+    <xsl:attribute name="space-before">10pt</xsl:attribute>
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+
+<xsl:template match="story/section/title">
+  <block xsl:use-attribute-sets="medium-title-font">
+    <xsl:attribute name="space-after">5pt</xsl:attribute>
+    <xsl:attribute name="space-before">10pt</xsl:attribute>
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+
+<xsl:template match="nda">
+  <block border="solid" padding="5pt" font-style="italic">
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+
+<xsl:template match="para">
+  <block xsl:use-attribute-sets="standard-block">
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+
+<!-- dialog template -->
+<xsl:template match="dialog">
+  <block xsl:use-attribute-sets="standard-block" start-indent="1cm">
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+<xsl:template match="cite">
+  <block xsl:use-attribute-sets="standard-block" font-style="italic">
+    <xsl:text>"</xsl:text>
+    <xsl:apply-templates/>
+    <xsl:text>"</xsl:text>
+  </block>
+</xsl:template>
+
+<xsl:template match="citation">
+  <block xsl:use-attribute-sets="standard-block" font-style="italic"
+         font-size="75%" margin-left="4in">
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+
+<xsl:template match="poem">
+  <block xsl:use-attribute-sets="standard-block" font-style="italic"
+     margin-left=".5in" margin-right=".5in">
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+
+<xsl:template match="strophe">
+  <block xsl:use-attribute-sets="standard-block">
+    <xsl:apply-templates/>
+  </block>
+</xsl:template>
+
+<xsl:template match="verse">
+  <block><xsl:apply-templates/></block>
+</xsl:template>
+
+</xsl:stylesheet>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: xml
+sgml-omittag:nil
+sgml-shorttag:nil
+sgml-namecase-general:nil
+sgml-general-insert-case:lower
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:nil
+sgml-parent-document:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+outline-regexp:"<xsl:"
+End:
+-->