Handling mult-column block-container in AHF area tree. Added ppl:is-first() and ppl:is-last() for use with AHF.
authorTony Graham
Mon, 28 Jul 2014 23:29:27 +0100
changeset 52 2ca58ce19d72
parent 51 53a9f2fe79d0
child 53 606c85f64e78
Handling mult-column block-container in AHF area tree. Added ppl:is-first() and ppl:is-last() for use with AHF.
FOPRunXSLTExt/examples/ppl-extensions.xsl
--- a/FOPRunXSLTExt/examples/ppl-extensions.xsl	Mon Jul 28 23:28:29 2014 +0100
+++ b/FOPRunXSLTExt/examples/ppl-extensions.xsl	Mon Jul 28 23:29:27 2014 +0100
@@ -135,7 +135,9 @@
 
   <xsl:sequence
       select="(ppli:fop-length-to-pt($block/block/@bpd),
-	       ppl:length-to-pt($block/*/ahf:BlockArea/@height))[1]" />
+	       max((ppl:sum-lengths-to-pt($block/ahf:FlowReferenceArea/*/@height),
+	            for $column-area in $block/ahf:MultiColumnReferenceArea/ahf:ColumnReferenceArea
+		      return ppl:sum-lengths-to-pt($column-area/ahf:FlowReferenceArea/*/@height))))[1]" />
 </xsl:function>
 
 <xsl:function name="ppl:block-ipd" as="xs:double">
@@ -155,6 +157,22 @@
 	       ppl:length-to-pt($block/ancestor::ahf:NormalFlowReferenceArea/@width))[1]" />
 </xsl:function>
 
+<!-- Currently AHF-only. -->
+<xsl:function name="ppl:is-first" as="xs:boolean">
+  <xsl:param name="block" as="element()" />
+
+  <xsl:sequence
+      select="$block/@is-first = 'true'" />
+</xsl:function>
+
+<!-- Currently AHF-only. -->
+<xsl:function name="ppl:is-last" as="xs:boolean">
+  <xsl:param name="block" as="element()" />
+
+  <xsl:sequence
+      select="$block/@is-last = 'true'" />
+</xsl:function>
+
 <xsl:variable name="ppl:units" as="element(unit)+">
   <unit name="in" per-inch="1"    per-pt="72" />
   <unit name="pt" per-inch="72"   per-pt="1" />