Added ppl:block-ipd() and ppl:block-available-ipd().
authorTony Graham
Wed, 05 Mar 2014 22:12:22 +0000
changeset 40 0da5b5a96244
parent 39 6438ee017386
child 41 61846273df58
Added ppl:block-ipd() and ppl:block-available-ipd().
FOPRunXSLTExt/examples/ppl-extensions.xsl
--- a/FOPRunXSLTExt/examples/ppl-extensions.xsl	Wed Mar 05 22:11:32 2014 +0000
+++ b/FOPRunXSLTExt/examples/ppl-extensions.xsl	Wed Mar 05 22:12:22 2014 +0000
@@ -137,4 +137,20 @@
 	       xs:double(substring-before($block/*/ahf:BlockArea/@height, 'pt')))[1]" />
 </xsl:function>
 
+<xsl:function name="ppl:block-ipd" as="xs:double">
+  <xsl:param name="block" as="element()" />
+
+  <xsl:sequence
+      select="(xs:double($block/block/@ipd) div 1000,
+	       xs:double(substring-before($block/*/ahf:BlockArea/@width, 'pt')))[1]" />
+</xsl:function>
+
+<xsl:function name="ppl:block-available-ipd" as="xs:double">
+  <xsl:param name="block" as="element()" />
+
+  <xsl:sequence
+      select="(xs:double($block/ancestor::flow/@ipd) div 1000,
+	       xs:double(substring-before($block/ancestor::ahf:NormalFlowReferenceArea/@width, 'pt')))[1]" />
+</xsl:function>
+
 </xsl:stylesheet>
\ No newline at end of file