How do you get different bullet characters that work for xsl-fo with XEP

532 Views Asked by At

Here's my code to select bullet types for different nested lists, but only the disc shows up in the PDF. How can I get a hollow circle and solid square symbol to show up?

<xsl:choose>
    <xsl:when test="parent::ul[ancestor::ul[ancestor::ul]]"><!--double nested bullet-->
        <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
        <fo:character character="&#x25A0;"/><!--solid square-->
    </xsl:when>
    <xsl:when test="parent::ul[ancestor::ul]"><!--single nested bullet-->
        <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
        <fo:character character="&#x2218;"/><!--hollow circle-->
    </xsl:when>
    <xsl:otherwise><!--bullet-->
        <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
        <fo:character character="&#x2022;"/><!--disc-->
    </xsl:otherwise>
</xsl:choose>
1

There are 1 best solutions below

0
On

I couldn't figure this out, so I just created png files for the glyphs, which is probably what I should have done in the first place. In case it's helpful to anyone else, here are the images I used:

Bullet 1 Bullet 2 Bullet 3

Here's a screenshot of the output:

PDF Output

And here's the new code:

<xsl:choose>
    <xsl:when test="parent::ol">
        <xsl:number format="1."/>
    </xsl:when>
    <xsl:when test="parent::ul[ancestor::ul[ancestor::ul]]"><!--double nested bullet-->
        <fo:external-graphic src="{$staticImages}bullet-level-3.png"/>
    </xsl:when>
    <xsl:when test="parent::ul[ancestor::ul]"><!--single nested bullet-->
        <fo:external-graphic src="{$staticImages}bullet-level-2.png"/>
    </xsl:when>
    <xsl:otherwise><!--bullet-->
        <fo:external-graphic src="{$staticImages}bullet-level-1.png"/>
    </xsl:otherwise>
</xsl:choose>