Hopefully the final tweaks to XML and XSLT, including cosmetic changes in the XSLT just to make the listing shorter.
authorTony Graham
Tue, 29 Jul 2014 11:51:36 +0100
changeset 56 b184e200b875
parent 55 873cf39a5e9c
child 57 cd5b574e550c
Hopefully the final tweaks to XML and XSLT, including cosmetic changes in the XSLT just to make the listing shorter.
FOPRunXSLTExt/examples/balisage2014.xml
FOPRunXSLTExt/examples/balisage2014.xsl
--- a/FOPRunXSLTExt/examples/balisage2014.xml	Tue Jul 29 00:33:22 2014 +0100
+++ b/FOPRunXSLTExt/examples/balisage2014.xml	Tue Jul 29 11:51:36 2014 +0100
@@ -1,28 +1,30 @@
 <example name="Balisage 2014">
-<header>Print and Page Layout <svg href="ppl-logo.svg" id="logo"/> Community Group<lb/>XSLT Extensions</header>
+<header>Print and Page Layout  <svg href="ppl-logo.svg" id="logo"/>  Community Group<lb/>XSLT Extensions</header>
 
-<box id="box001" width="2240pt" height="540pt">
-<paragraph id="para001">The XSLT extension functions from the Print and Page Layout Community Group @ W3C (see <url>https://www.w3.org/community/ppl/wiki/XSLTExtensions</url>) allow you to run your XSL-FO formatter within your XSLT transform, and do it as often as you like, to get an area tree and make decisions based on formatted areas to do things like:</paragraph>
+<box id="box001" width="2240pt" height="520pt">
+<paragraph id="para001">The Print and Page Layout Community Group @ W3C (<url>www.w3.org/community/ppl/</url>) is open to all aspects of page
+layout theory and practice.  It is free to join, and all are welcome at all levels of expertise.</paragraph>
+<paragraph>The XSLT extension functions (<url>www.w3.org/community/ppl/wiki/XSLTExtensions</url>) allow you to run your XSL-FO formatter within your XSLT transform to get an area tree, and to do it as often as you like, so the XSLT can make decisions based on formatted areas to do things like:</paragraph>
 <list id="list009">
-  <item label="*">Adjust the start-indent of a <code>fo:list-block</code> based on the length of the longest <code>fo:list-item-label</code>; or</item>
-  <item label="*">Size this text to be <font-size/> so it fits this box.</item>
+  <item label="&#x2013;">Adjust the start-indent of a <code>fo:list-block</code> based on the length of the longest <code>fo:list-item-label</code> in the list; or</item>
+  <item label="&#x2014;">Size this text to be <font-size/> so it fits this box.</item>
 </list>
 </box>
-<box id="box002" width="2240pt" height="630pt" columns="2" border="none">
+<box id="box002" width="2240pt" height="690pt" columns="2" border="none">
 <title>XSLT and XSL-FO Processors</title>
 <paragraph id="para002">The extension is available for Java and DotNet and uses either the Apache FOP XSL formatter or Antenna House AHF formatter to produce the area trees.</paragraph>
-<paragraph>The single Java jar file covers four combinations of XSLT processor and XSL-FO formatter:</paragraph>
+<paragraph>A single Java jar file covers four combinations of XSLT processor and XSL-FO formatter:</paragraph>
 <list id="list001">
   <item label="*">Saxon 9.5 and FOP</item>
-  <item label="*">Saxon 9.5 and Antenna House</item>
-  <item label="*">Xalan and FOP</item>
-  <item label="*">Xalan and Antenna House</item>
+  <item label="†">Saxon 9.5 and Antenna House</item>
+  <item label="‡">Xalan and FOP</item>
+  <item label="§">Xalan and Antenna House</item>
 </list>
 <paragraph>The DotNet version supports:</paragraph>
 
 <list id="list002">
-  <item label="*">DotNet 4.0 and FOP</item>
-  <item label="*">DotNet 4.0 and Antenna House</item>
+  <item label="&#x2013;">DotNet 4.0 and FOP</item>
+  <item label="&#x2014;">DotNet 4.0 and Antenna House</item>
 </list>
 <title>API</title>
 <paragraph>The PPL CG provides <code>ppl:area-tree()</code> for running the formatter and getting the area tree plus a selection of convenience functions to help hide both the details of the area tree and the differences between the area trees of different XSL-FO formatters.</paragraph>
@@ -65,7 +67,7 @@
   </item>
   <item>
     <function>bogus</function>
-    <def>Not a function, just an illustration of how, by using the extension functions to find the formatted size of the function definition, the <code>fo:list-item-body</code> moves down only for long function definitions.</def>
+    <def>Not a function, just an illustration of how, by using the extension functions to find the formatted size of the function definition, the <code>fo:list-item-body</code> moves down only for long function definitions.  <code>troff</code> can do it, so why shouldn&#x2019;t we?</def>
   </item>
 </api-list>
 </box>
--- a/FOPRunXSLTExt/examples/balisage2014.xsl	Tue Jul 29 00:33:22 2014 +0100
+++ b/FOPRunXSLTExt/examples/balisage2014.xsl	Tue Jul 29 11:51:36 2014 +0100
@@ -84,8 +84,8 @@
   <xsl:attribute name="font-weight" select="'bold'" />
   <xsl:attribute name="font-size" select="'2em'" />
   <xsl:attribute name="keep-with-next" select="'always'" />
-  <xsl:attribute name="space-before" select="'1em'" />
-  <xsl:attribute name="space-after" select="'0.5em'" />
+  <xsl:attribute name="space-before" select="'0.5em'" />
+  <xsl:attribute name="space-after" select="'0.25em'" />
 </xsl:attribute-set>
 
 <xsl:attribute-set name="code">
@@ -100,7 +100,9 @@
   <xsl:attribute name="white-space-treatment" select="'preserve'" />
   <xsl:attribute name="axf:line-number" select="'show'" />
   <xsl:attribute name="axf:line-number-color" select="'silver'" />
-  <xsl:attribute name="axf:line-number-font-size" select="'0.75em'" />
+  <xsl:attribute name="axf:line-number-font-size" select="'1em'" />
+  <xsl:attribute name="axf:line-number-font-family"
+		 select="'Calluna Sans, Verdana, sans-serif'" />
 </xsl:attribute-set>
 
 <!-- ============================================================= -->
@@ -113,31 +115,28 @@
 
   <xsl:apply-templates select="/" mode="ppl">
     <xsl:with-param name="font-size"
-		    select="$font-size" as="xs:double" tunnel="yes" />
-    <xsl:with-param name="source"
-		    as="element()*">
+                    select="$font-size" as="xs:double" tunnel="yes" />
+    <xsl:with-param name="source" as="element()*">
       <fo:block-container
-	  font-size="9pt"
-	  axf:column-count="5"
-	  column-gap="48pt"
-	  space-before="30pt">
-	<fo:block xsl:use-attribute-sets="title">XML</fo:block>
-	<fo:block xsl:use-attribute-sets="code-block"
-		  background-color="#f0f3f3">
-	  <xsl:sequence
-	      select="if ($pygmentize ne 'no')
-			then doc(concat(tokenize(base-uri(), '/')[last()], '.fo'))
-		      else unparsed-text(base-uri())" />
-	</fo:block>
-	<fo:block xsl:use-attribute-sets="title">XSLT</fo:block>
-	<fo:block height="100%"
-		  xsl:use-attribute-sets="code-block"
-		  background-color="#f0f3f3"
-		  display-align="justify">
-	  <xsl:sequence
-	      select="if ($pygmentize ne 'no')
-			then doc(concat(tokenize(base-uri(doc('')), '/')[last()], '.fo'))
-		      else unparsed-text('')" />
+          font-size="9pt"
+          axf:column-count="5"
+          column-gap="48pt"
+          space-before="30pt">
+        <fo:block xsl:use-attribute-sets="title">XML</fo:block>
+        <fo:block xsl:use-attribute-sets="code-block"
+                  background-color="#f0f3f3">
+          <xsl:sequence
+              select="if ($pygmentize ne 'no')
+                        then doc(concat(tokenize(base-uri(), '/')[last()], '.fo'))
+                      else unparsed-text(base-uri())" />
+        </fo:block>
+        <fo:block xsl:use-attribute-sets="title">XSLT</fo:block>
+        <fo:block height="100%" xsl:use-attribute-sets="code-block"
+                  background-color="#f0f3f3" display-align="justify">
+          <xsl:sequence
+              select="if ($pygmentize ne 'no')
+                        then doc(concat(tokenize(base-uri(doc('')), '/')[last()], '.fo'))
+                      else unparsed-text('')" />
           </fo:block>
         </fo:block-container>
     </xsl:with-param>
@@ -161,40 +160,40 @@
   <xsl:call-template name="do-box">
     <xsl:with-param name="font-size" select="$font-size" as="xs:double" tunnel="yes" />
     <xsl:with-param name="font-size.minimum"
-		    select="$font-size" as="xs:double" tunnel="yes" />
+                    select="$font-size" as="xs:double" tunnel="yes" />
     <xsl:with-param name="font-size.maximum"
-		    select="$font-size * 6" as="xs:double" tunnel="yes" />
+                    select="$font-size * 6" as="xs:double" tunnel="yes" />
     <xsl:with-param name="iteration" select="1" as="xs:integer" />
     <xsl:with-param name="iteration-max"
-		    select="$iteration-max" as="xs:integer" tunnel="yes" />
+                    select="$iteration-max" as="xs:integer" tunnel="yes" />
     <xsl:with-param name="tolerance"
-		    select="$tolerance" as="xs:double" tunnel="yes" />
+                    select="$tolerance" as="xs:double" tunnel="yes" />
     <xsl:with-param name="font-size-tolerance"
-		    select="$font-size-tolerance"
-		    as="xs:double" tunnel="yes" />
+                    select="$font-size-tolerance"
+                    as="xs:double" tunnel="yes" />
   </xsl:call-template>
 </xsl:template>
 
 <xsl:template name="do-box">
   <xsl:param name="font-size" as="xs:double" tunnel="yes" />
   <xsl:param name="font-size.minimum"
-	     as="xs:double" tunnel="yes" />
+             as="xs:double" tunnel="yes" />
   <xsl:param name="font-size.maximum"
-	     as="xs:double" tunnel="yes" />
+             as="xs:double" tunnel="yes" />
   <xsl:param name="iteration"
-	     select="1" as="xs:integer" />
+             select="1" as="xs:integer" />
   <xsl:param name="iteration-max"
-	     select="5" as="xs:integer" tunnel="yes" />
+             select="5" as="xs:integer" tunnel="yes" />
   <xsl:param name="tolerance"
-	     select="$tolerance" as="xs:double" tunnel="yes" />
+             select="$tolerance" as="xs:double" tunnel="yes" />
   <xsl:param name="font-size-tolerance"
-	     select="$font-size-tolerance"
-	     as="xs:double" tunnel="yes" />
+             select="$font-size-tolerance"
+             as="xs:double" tunnel="yes" />
 
-  <xsl:message>iteration = <xsl:value-of select="$iteration" /></xsl:message>
-  <xsl:message>font-size = <xsl:value-of select="$font-size" /></xsl:message>
-  <xsl:message>font-size.minimum = <xsl:value-of select="$font-size.minimum" /></xsl:message>
-  <xsl:message>font-size.maximum = <xsl:value-of select="$font-size.maximum" /></xsl:message>
+  <xsl:message select="concat('iteration = ', $iteration)" />
+  <xsl:message select="concat('font-size = ', $font-size)" />
+  <xsl:message select="concat('font-size.minimum = ', $font-size.minimum)" />
+  <xsl:message select="concat('font-size.maximum = ', $font-size.maximum)" />
 
   <xsl:variable name="overrides">
     <overrides>
@@ -215,8 +214,8 @@
   <xsl:variable name="fo_tree">
     <xsl:apply-templates select="$this-box" mode="#default">
       <xsl:with-param name="overrides"
-		      select="$overrides"
-		      as="document-node()" tunnel="yes" />
+                      select="$overrides"
+                      as="document-node()" tunnel="yes" />
     </xsl:apply-templates>
   </xsl:variable>
 
@@ -225,28 +224,21 @@
       select="ppl:area-tree($fo_tree)"
       as="document-node()?" />
 
-  <xsl:variable
-      name="block"
-      select="ppl:block-by-id($area-tree, @id)"
-      as="element()" />
+  <xsl:variable name="block" select="ppl:block-by-id($area-tree, @id)"
+		as="element()" />
 
-  <xsl:variable
-      name="bpd"
-      select="ppl:block-bpd($block)"
-      as="xs:double" />
+  <xsl:variable name="bpd" select="ppl:block-bpd($block)" as="xs:double" />
 
-  <xsl:variable
-      name="target-height"
-      select="ppl:length-to-pt(@height)"
-      as="xs:double" />
+  <xsl:variable name="target-height" select="ppl:length-to-pt(@height)"
+		as="xs:double" />
 
   <xsl:message select="concat('bpd: ', $bpd)" />
   <xsl:message select="concat('target-height: ', $target-height)" />
   <xsl:choose>
     <xsl:when test="$target-height - $bpd > 0 and
                     $target-height - $bpd &lt; $tolerance and
-		    ppl:is-last($block)">
-      <xsl:message>It fits.  Using <xsl:value-of select="$font-size" />.</xsl:message>
+                    ppl:is-last($block)">
+      <xsl:message select="concat('It fits.  Using ', $font-size, '.')" />
       <xsl:apply-templates select="." mode="#default">
         <xsl:with-param
             name="overrides"
@@ -256,19 +248,16 @@
       </xsl:apply-templates>
     </xsl:when>
     <xsl:when test="$font-size.maximum - $font-size.minimum &lt; $font-size-tolerance and
-		    $target-height - $bpd > 0 and
-		    ppl:is-last($block)">
+                    $target-height - $bpd > 0 and ppl:is-last($block)">
       <xsl:message>Font size difference less than $font-size-tolerance.  Using <xsl:value-of select="$font-size" />.</xsl:message>
       <xsl:apply-templates select="." mode="#default">
         <xsl:with-param
-            name="overrides"
-            select="$overrides"
-            as="document-node()"
-            tunnel="yes" />
+            name="overrides" select="$overrides"
+            as="document-node()" tunnel="yes" />
       </xsl:apply-templates>
     </xsl:when>
     <xsl:when test="$iteration eq $iteration-max">
-      <xsl:message>Maximum iterations.  Using <xsl:value-of select="$font-size" />.</xsl:message>
+      <xsl:message select="concat('>Maximum iterations.  Using ', $font-size, '.')" />
       <xsl:apply-templates select="." mode="#default">
         <xsl:with-param
             name="overrides"
@@ -278,7 +267,7 @@
       </xsl:apply-templates>
     </xsl:when>
     <xsl:when test="$bpd > $target-height or
-		    not(ppl:is-last($block))">
+                    not(ppl:is-last($block))">
       <xsl:message>$bpd gt $target-height or not last</xsl:message>
       <xsl:call-template name="do-box">
         <xsl:with-param
@@ -292,7 +281,7 @@
             as="xs:double"
             tunnel="yes" />
         <xsl:with-param name="iteration"
-			select="$iteration + 1" as="xs:integer" />
+                        select="$iteration + 1" as="xs:integer" />
       </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
@@ -309,7 +298,7 @@
             as="xs:double"
             tunnel="yes" />
         <xsl:with-param name="iteration"
-			select="$iteration + 1" as="xs:integer" />
+                        select="$iteration + 1" as="xs:integer" />
       </xsl:call-template>
     </xsl:otherwise>
   </xsl:choose>
@@ -333,12 +322,12 @@
     </fo:layout-master-set>
 
     <fo:page-sequence master-reference="test-page"
-		      axf:line-number-start="5"
-		      axf:line-number-interval="5"
-		      axf:line-number-offset="0.375em + 6pt">
+                      axf:line-number-start="5"
+                      axf:line-number-interval="5"
+                      axf:line-number-offset="0.375em + 6pt">
       <fo:flow flow-name="xsl-region-body">
         <xsl:apply-templates mode="#current" />
-	<xsl:sequence select="$source" />
+        <xsl:sequence select="$source" />
       </fo:flow>
     </fo:page-sequence>
   </fo:root>
@@ -356,38 +345,33 @@
   <xsl:variable name="fo_tree">
     <xsl:apply-templates select="$tmp-doc" mode="#default">
       <xsl:with-param name="overrides" as="document-node()" tunnel="yes">
-	<xsl:document>
-	  <overrides>
-	    <override id="header" font-size="{$header-font-size}pt" />
-	  </overrides>
-	</xsl:document>
+        <xsl:document>
+          <overrides>
+            <override id="header" font-size="{$header-font-size}pt" />
+          </overrides>
+        </xsl:document>
       </xsl:with-param>
     </xsl:apply-templates>
   </xsl:variable>
 
-  <xsl:variable name="area-tree"
-		select="ppl:area-tree($fo_tree)"
-		as="document-node()?" />
+  <xsl:variable name="area-tree" select="ppl:area-tree($fo_tree)"
+                as="document-node()?" />
 
-  <xsl:variable name="block"
-		select="ppl:block-by-id($area-tree, 'header')"
-		as="element()" />
+  <xsl:variable name="block" select="ppl:block-by-id($area-tree, 'header')"
+                as="element()" />
 
-  <xsl:variable name="ipd"
-		select="ppl:block-ipd($block)"
-		as="xs:double" />
+  <xsl:variable name="ipd" select="ppl:block-ipd($block)" as="xs:double" />
 
-  <xsl:variable name="available-ipd"
-		select="ppl:block-available-ipd($block)"
-		as="xs:double" />
+  <xsl:variable name="available-ipd" select="ppl:block-available-ipd($block)"
+                as="xs:double" />
 
   <xsl:apply-templates select="." mode="#default">
     <xsl:with-param name="overrides" tunnel="yes">
       <xsl:document>
-	<overrides>
-	  <override id="header"
-		    font-size="{$header-font-size * $available-ipd div $ipd}pt" />
-	</overrides>
+        <overrides>
+          <override id="header"
+                    font-size="{$header-font-size * $available-ipd div $ipd}pt" />
+        </overrides>
       </xsl:document>
     </xsl:with-param>
   </xsl:apply-templates>
@@ -395,14 +379,14 @@
 
 <xsl:template match="header">
   <xsl:param name="overrides" select="$overrides"
-	     as="document-node()" tunnel="yes"/>
+             as="document-node()" tunnel="yes"/>
   <fo:block-container
       font-size="{(key('overrides', 'header', $overrides)/@font-size, '14pt')[1]}"
       space-before="5mm" space-after="5mm"
       font-weight="900" text-align="center" id="header">
     <fo:block
-	line-height="1.2em"
-	line-height-shift-adjustment="disregard-shifts">
+        line-height="1.2em"
+        line-height-shift-adjustment="disregard-shifts">
       <xsl:apply-templates />
     </fo:block>
   </fo:block-container>
@@ -414,7 +398,7 @@
 
 <xsl:template match="box">
   <xsl:param name="overrides" select="$overrides"
-	     as="document-node()" tunnel="yes"/>
+             as="document-node()" tunnel="yes"/>
 
   <fo:block-container
       role="{local-name()}" border="{(@border, 'medium solid black')[1]}"
@@ -436,7 +420,9 @@
 </xsl:template>
 
 <xsl:template match="paragraph">
-  <fo:block id="{@id}" text-align="justify" space-before="3pt">
+  <fo:block id="{@id}" text-align="justify" space-before="3pt"
+	    text-indent="{if (preceding-sibling::*[1][self::paragraph])
+			    then '1em' else '0pt'}">
     <xsl:apply-templates/>
   </fo:block>
 </xsl:template>
@@ -448,9 +434,9 @@
   <xsl:variable name="tmp-doc">
     <box id="labels" font-size="{$font-size}">
       <xsl:for-each select="item/@label">
-	<paragraph>
+        <paragraph>
 	  <xsl:value-of select="." />
-	</paragraph>
+        </paragraph>
       </xsl:for-each>
     </box>
   </xsl:variable>
@@ -459,26 +445,22 @@
   <xsl:variable name="fo_tree">
     <xsl:apply-templates select="$tmp-doc" mode="#default">
       <xsl:with-param name="overrides" as="document-node()" tunnel="yes">
-	<xsl:document>
-	  <overrides>
-	    <override id="labels" font-size="{$font-size}" />
-	  </overrides>
-	</xsl:document>
+        <xsl:document>
+          <overrides>
+            <override id="labels" font-size="{$font-size}" />
+          </overrides>
+        </xsl:document>
       </xsl:with-param>
     </xsl:apply-templates>
   </xsl:variable>
 
-  <xsl:variable name="area-tree"
-		select="ppl:area-tree($fo_tree)"
-		as="document-node()?" />
+  <xsl:variable name="area-tree" select="ppl:area-tree($fo_tree)"
+                as="document-node()?" />
 
-  <xsl:variable name="block"
-		select="ppl:block-by-id($area-tree, 'labels')"
-		as="element()" />
+  <xsl:variable name="block" select="ppl:block-by-id($area-tree, 'labels')"
+                as="element()" />
 
-  <xsl:variable name="ipd"
-		select="ppl:block-ipd($block)"
-		as="xs:double" />
+  <xsl:variable name="ipd" select="ppl:block-ipd($block)" as="xs:double" />
 
   <xsl:message select="concat('list labels ipd: ', $ipd)"/>
 
@@ -496,7 +478,7 @@
   <fo:list-item space-before="3pt" relative-align="baseline">
     <fo:list-item-label end-indent="label-end()">
       <fo:block color="red">
-        <xsl:apply-templates select="@label"/>
+	<xsl:value-of select="@label"/>
       </fo:block>
     </fo:list-item-label>
     <fo:list-item-body start-indent="body-start()">
@@ -520,54 +502,50 @@
 <xsl:template match="api-list/item">
   <xsl:param name="font-size" as="xs:double" tunnel="yes" />
 
-  <fo:list-item space-before="3pt" keep-together.within-column="always">
+  <fo:list-item space-before="6pt" keep-together.within-column="always">
     <fo:list-item-label end-indent="0">
       <xsl:apply-templates select="function"/>
     </fo:list-item-label>
     <fo:list-item-body start-indent="body-start()">
       <!-- Get a document containing just the label. -->
       <xsl:variable name="tmp-doc">
-	<box id="function" font-size="{$font-size}">
-	  <paragraph>
-	    <code>
-	      <xsl:value-of select="function" />
-	    </code>
-	  </paragraph>
-	</box>
+        <box id="function" font-size="{$font-size}">
+          <paragraph>
+            <code>
+              <xsl:value-of select="function" />
+            </code>
+          </paragraph>
+        </box>
       </xsl:variable>
 
       <!-- Save the FO tree for the function in a variable. -->
       <xsl:variable name="fo_tree">
-	<xsl:apply-templates select="$tmp-doc" mode="#default">
-	  <xsl:with-param name="overrides" as="document-node()" tunnel="yes">
-	    <xsl:document>
-	      <overrides>
-		<override id="function" font-size="{$font-size}" />
-	      </overrides>
-	    </xsl:document>
-	  </xsl:with-param>
-	</xsl:apply-templates>
+        <xsl:apply-templates select="$tmp-doc" mode="#default">
+          <xsl:with-param name="overrides" as="document-node()" tunnel="yes">
+            <xsl:document>
+              <overrides>
+                <override id="function" font-size="{$font-size}" />
+              </overrides>
+            </xsl:document>
+          </xsl:with-param>
+        </xsl:apply-templates>
       </xsl:variable>
 
-      <xsl:variable name="area-tree"
-		    select="ppl:area-tree($fo_tree)"
-		    as="document-node()?" />
+      <xsl:variable name="area-tree" select="ppl:area-tree($fo_tree)"
+                    as="document-node()?" />
 
-      <xsl:variable name="block"
-		    select="ppl:block-by-id($area-tree, 'function')"
-		    as="element()" />
+      <xsl:variable name="block" as="element()"
+                    select="ppl:block-by-id($area-tree, 'function')" />
 
-      <xsl:variable name="ipd"
-		    select="ppl:block-ipd($block)"
-		    as="xs:double" />
+      <xsl:variable name="ipd" select="ppl:block-ipd($block)"
+                    as="xs:double" />
 
       <xsl:message select="concat('function: ', function, '; ipd: ', $ipd)"/>
 
       <xsl:if test="$ipd > ppl:length-to-pt('35mm')">
-	<fo:block />
+        <fo:block />
       </xsl:if>
-      <fo:block space-before="1.5em"
-		space-before.conditionality="retain">
+      <fo:block space-before="1.2em" space-before.conditionality="retain">
         <xsl:apply-templates select="def" />
       </fo:block>
     </fo:list-item-body>
@@ -581,9 +559,8 @@
 </xsl:template>
 
 <xsl:template match="svg">
-  <fo:instream-foreign-object
-      id="{@id}" content-height="1.8em"
-      alignment-adjust="-0.25em">
+  <fo:instream-foreign-object content-height="1.8em"
+			      alignment-adjust="-0.25em">
     <xsl:copy-of select="document(@href)"/>
   </fo:instream-foreign-object>
 </xsl:template>