htmlxsltxsl-foapache-fop

FO List Block change style


I am using XSL FO list block to show bullet points. Is it possible to change list-style-type to show square (or other shape)? In HTML, it is <ul style="list-style-type:square;">

Code:

<fo:list-block>
<fo:list-item>
 <fo:list-item-label>
   <fo:block>*</fo:block>
 </fo:list-item-label>
 <fo:list-item-body>
   <fo:block>Volvo</fo:block>
 </fo:list-item-body>
</fo:list-item>
<fo:list-item>
 <fo:list-item-label>
   <fo:block>*</fo:block>
 </fo:list-item-label>
 <fo:list-item-body>
   <fo:block>Saab</fo:block>
 </fo:list-item-body>
</fo:list-item>
</fo:list-block>

Solution

  • Put the character that you want in place of the *:

    <fo:list-item-label>
      <fo:block color="blue" font-weight="bold" font-size="1.3em">✪</fo:block>
     </fo:list-item-label>
    

    This looks like a lot of work compared to <ul style="list-style-type:square;">, but: