'example5.xsl' now independent of which formatter beig used.
authorTony Graham
Sun, 09 Feb 2014 22:29:00 +0000
changeset 32 4927a0669498
parent 31 2cc547dd6415
child 33 3eaa6a425b51
'example5.xsl' now independent of which formatter beig used.
FOPRunXSLTExt/examples/example5.xsl
FOPRunXSLTExt/examples/ppl-extensions.xsl
--- a/FOPRunXSLTExt/examples/example5.xsl	Sun Feb 09 22:20:32 2014 +0000
+++ b/FOPRunXSLTExt/examples/example5.xsl	Sun Feb 09 22:29:00 2014 +0000
@@ -4,7 +4,7 @@
 <!--                                                               -->
 <!-- See http://www.w3.org/community/ppl/wiki/FOPRunXSLTExt        -->
 <!--                                                               -->
-<!-- Requires Saxon 9.5 or later and FOP 1.0                       -->
+<!-- Requires Saxon 9.5 or later and FOP 1.0 or AHF 6.1            -->
 <!--                                                               -->
 <!-- Produced by the Print and Page Layout Community Group @ W3C   -->
 <!-- ============================================================= -->
@@ -14,8 +14,7 @@
     xmlns:ppl="http://www.w3.org/community/ppl/ns/"
     xmlns:fo="http://www.w3.org/1999/XSL/Format"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:ahf="http://www.antennahouse.com/names/XSL/AreaTree"
-    exclude-result-prefixes="ppl xs ahf">
+    exclude-result-prefixes="ppl xs">
 
 <!-- Print and Page Layout Community Group extensions. -->
 <xsl:import href="ppl-extensions.xsl" />
@@ -113,8 +112,7 @@
 
   <xsl:variable
       name="bpd"
-      select="(xs:double($block/block/@bpd) div 1000,
-	       xs:double(substring-before($block/*/ahf:BlockArea/@height, 'pt')))[1]"
+      select="ppl:block-bdp($block)"
       as="xs:double" />
 
   <xsl:variable
--- a/FOPRunXSLTExt/examples/ppl-extensions.xsl	Sun Feb 09 22:20:32 2014 +0000
+++ b/FOPRunXSLTExt/examples/ppl-extensions.xsl	Sun Feb 09 22:29:00 2014 +0000
@@ -110,11 +110,19 @@
   <xsl:sequence select="se:area-tree($fo-tree)"/>
 </xsl:function>
 
-<xsl:function name="ppl:block-by-id" as="node()?">
+<xsl:function name="ppl:block-by-id" as="element()?">
   <xsl:param name="area-tree" as="document-node()" />
   <xsl:param name="id" as="xs:string" />
 
   <xsl:sequence select="key('blocks', $id, $area-tree)[1]" />
 </xsl:function>
 
+<xsl:function name="ppl:block-bpd" as="xs:double">
+  <xsl:param name="block" as="element()" />
+
+  <xsl:sequence
+      select="(xs:double($block/block/@bpd) div 1000,
+	       xs:double(substring-before($block/*/ahf:BlockArea/@height, 'pt')))[1]" />
+</xsl:function>
+
 </xsl:stylesheet>
\ No newline at end of file