Note that there are some explanatory texts on larger screens.

plurals
  1. POusing xslt stylesheet to convert xhtml blank lines to an XSL-FO blank line
    primarykey
    data
    text
    <p>I'm using an XSLT stylesheet (by Antennahouse) to convert XHTML to an XSL-FO file. I defined a blank line in my XHTML file as 2 consecutive HTML BR tags. Now there is no native support for a blank line in the XSL-FO format. I want to work around this limitation by adding a height to the fo:block that the stylesheet inserts for a BR tag. However I'm new to the XSLT language and I'm having some problems doing this. </p> <p>I can figure out how to insert this height for every BR tag I encounter, but I only want the blank line to be inserted when there are 2 BR tags after each other (otherwise a blank line would be inserted after every text followed by a BR tag.)</p> <p>I got as far as making a 'nonsense' expression (11 is greater than 10) which will define when to insert a regular fo:block or an fo:block with space-after="1em". Obviously this expression makes no sense, what it should check on is whether this BR element is the second one in a row. If anyone could help me out here or point me in the right direction, it would be greatly appreciated. This is what I have right now:</p> <pre><code>&lt;xsl:template match="html:br"&gt; &lt;xsl:choose&gt; &lt;xsl:when test="11 &amp;gt; 10"&gt; &lt;fo:block space-after="1em"&gt; &lt;xsl:call-template name="process-common-attributes"/&gt; &lt;/fo:block&gt; &lt;/xsl:when&gt; &lt;xsl:otherwise&gt; &lt;fo:block&gt; &lt;xsl:call-template name="process-common-attributes"/&gt; &lt;/fo:block&gt; &lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; </code></pre> <p></p> <p>For reference sake, this is a piece of XHTML where I want the double BR tags to be transformed into a blank line, but the single BR tags should simply be a regular line break.</p> <pre><code> &lt;div style="color: #000000; font-family: arial; font-size: 10pt; font-style: normal; font-weight: normal;"&gt; &lt;span&gt;description&lt;/span&gt; &lt;br/&gt; &lt;span&gt;using&lt;/span&gt; &lt;br/&gt; &lt;span&gt;multiple&lt;/span&gt; &lt;br/&gt; &lt;span&gt;lines&lt;/span&gt; &lt;br/&gt; &lt;br/&gt; &lt;span&gt;with&lt;/span&gt; &lt;br/&gt; &lt;br/&gt; &lt;span&gt;blank&lt;/span&gt; &lt;br/&gt; &lt;br/&gt; &lt;span&gt;lines&lt;/span&gt; &lt;br/&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload