1 2 3 | <center> Table of Contents </center> |
1 2 3 | <fo:block text-align="center"> Table of Contents </fo:block> |
1 2 3 4 5 6 7 | <xsl:template match="center"> <fo:block text-align="center"> <xsl:apply-templates select="*|text()"/> </fo:block> </xsl:template> |
1 2 3 4 5 6 | <p> When she was little, my daughter loved it when I read <cite>Goodnight Moon</cite> to her. <i>But <cite>Harold and the Purple Crayon</cite> was her favorite.</i> </p> |
1 2 3 4 5 6 7 8 | <fo:block> When she was little, my daughter loved it when I read <fo:inline font-style="italic">Goodnight Moon</fo:inline> to her. <fo:inline font-style="italic">But <fo:inline font-style="normal">Harold and the Purple Crayon</fo:inline> was her favorite. </fo:inline> </fo:block> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <xsl:template match="cite"> <xsl:choose> <xsl:when test="parent::i"> <fo:inline font-style="normal"> <xsl:apply-templates select="*|text()"/> </fo:inline> </xsl:when> <xsltherwise> <fo:inline font-style="italic"> <xsl:apply-templates select="*|text()"/> </fo:inline> </xsltherwise> </xsl:choose> </xsl:template> |
1 2 | <p>If you're a Java programmer, an easy way to break a string apart is with the <code>java.util.StringTokenizer</code> class.</p> |
1 2 3 4 5 | <fo:block>If you're a Java programmer, an easy way to break a string apart is with the <fo:inline font-family="monospace">java.util.StringTokenizer</fo:inline> class. </fo:block> |
1 2 3 4 5 6 7 | <xsl:template match="code"> <fo:inline font-family="monospace"> <xsl:apply-templates select="*|text()"/> </fo:inline> </xsl:template> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <p>There are four valid values for the <code>text-align</code> parameter:</p> <dl> <dt>start</dt> <dd> The text is aligned at the start of the paragraph, normally the left side. </dd> <dt>middle</dt> <dd>The text is aligned at the middle of the paragraph.</dd> <dt>end</dt> <dd> The text is aligned at the end of the paragraph, normally the right side. </dd> <dt>justify</dt> <dd>The text is aligned at both the start and end of the paragraph.</dd> </dl> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <xsl:template match="dl"> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="dt"> <fo:block font-weight="bold" space-after="2pt" keep-with-next="always"> <xsl:apply-templates select="*|text()"/> </fo:block> </xsl:template> <xsl:template match="dd"> <fo:block start-indent="1cm"> <xsl:attribute name="space-after"> <xsl:choose> <xsl:when test="name(following::*[1]) = 'dd'"> <xsl:text>3pt</xsl:text> </xsl:when> <xsltherwise> <xsl:text>12pt</xsl:text> </xsltherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates select="*|text()"/> </fo:block> </xsl:template> |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |