0

这是我为不同的嵌套列表选择项目符号类型的代码,但只有光盘显示在 PDF 中。我怎样才能显示一个空心圆圈和实心方形符号?

<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>
4

1 回答 1

0

我想不通,所以我只是为字形创建了 png 文件,这可能是我一开始就应该做的。如果它对其他人有帮助,这里是我使用的图像:

子弹 1 子弹 2 子弹 3

这是输出的屏幕截图:

PDF 输出

这是新代码:

<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>
于 2020-01-14T17:34:13.197 回答