代码之家  ›  专栏  ›  技术社区  ›  Mica

强调DocBook、FO、PDF输出中的文本

  •  0
  • Mica  · 技术社区  · 15 年前

    我试图强调一些静态文本的一个字符,以呈现到PDF的页脚中,但在XSL中找不到标记的正确组合。我怎样才能做到这一点?

    例子:

    <!-- Footer content -->
    <xsl:template name="footer.content">  
      <xsl:param name="pageclass" select="''"/>
      <xsl:param name="sequence" select="''"/>
      <xsl:param name="position" select="''"/>
      <xsl:param name="gentext-key" select="''"/>
    
    <fo:block>
    <xsl:choose>
    
    ...
    <xsl:when test="$sequence = 'odd' and $position = 'left'">
            <xsl:text>&#x00A9;<emphasis>My</emphasis>Company</xsl:text>
    </xsl:when>
    ...
    </xsl:choose>
    </fo:block>
    </xsl:template>
    

    此示例在xsltproc中生成错误。救命!

    1 回复  |  直到 15 年前
        1
  •  0
  •   Daniel Haley    15 年前

    试用使用 fo:inline .

    我不确定你想要达到什么样的强调,或者你得到了什么样的错误,但是尝试这样的方法:

    <!-- Footer content -->
    <xsl:template name="footer.content">  
      <xsl:param name="pageclass" select="''"/>
      <xsl:param name="sequence" select="''"/>
      <xsl:param name="position" select="''"/>
      <xsl:param name="gentext-key" select="''"/>
    
    <fo:block>
    <xsl:choose>
    
    ...
    <xsl:when test="$sequence = 'odd' and $position = 'left'">
            <xsl:text>&#x00A9;</xsl:text><fo:inline text-decoration="underline">My</fo:inline><xsl:text>Company</xsl:text>
    </xsl:when>
    ...
    </xsl:choose>
    </fo:block>
    

    希望这有帮助。

    推荐文章