1 2 3 4 5 6 7 | <h1>Sample text from Henry Fielding's <cite>Tom Jones</cite></h1> <h2><b>Book I.</b> Containing as Much of the Birth of the Foundling as Is Necessary or Proper to Acquaint the Reader with in the Beginning of This History</h2> <h3><b>Chapter VII.</b> Containing Such Grave Matter, That the Reader Cannot Laugh Once Through the Whole Chapter, Unless Peradventure He Should Laugh at the Author</h3> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <fo:block break-before="page"> <fo:leader leader-pattern="rule"/> </fo:block> <fo:block font-family="serif" space-after="22pt" keep-with-next="always" line-height="32pt" font-size="28pt" id="tomjones"> Sample text from Henry Fielding's <fo:inline font-style="italic">Tom Jones</fo:inline> </fo:block> <fo:block font-family="serif" space-after="18pt" keep-with-next="always" line-height="28pt" font-size="24pt" id="N10017"> <fo:inline font-weight="bold">Book I.</fo:inline> Containing as Much of the Birth of the Foundling as Is Necessary or Proper to Acquaint the Reader with in the Beginning of This History </fo:block> <fo:block font-family="serif" space-after="14pt" keep-with-next="always" line-height="24pt" font-size="21pt" id="N1001C"> <fo:inline font-weight="bold">Chapter VII.</fo:inline> Containing Such Grave Matter, That the Reader Cannot Laugh Once Through the Whole Chapter, Unless Peradventure He Should Laugh at the Author </fo:block> |
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | <xsl:template match="h1"> <fo:block break-before="page"> <fo:leader leader-pattern="rule"/> </fo:block> <fo:block font-size="28pt" line-height="32pt" keep-with-next="always" space-after="22pt" font-family="serif"> <xsl:attribute name="id"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsl:when test="name(preceding-sibling::*[1]) = 'a' and preceding-sibling::*[1][@name]"> <xsl:value-of select="preceding-sibling::*[1]/@name"/> </xsl:when> <xsltherwise> <xsl:value-of select="generate-id()"/> </xsltherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates select="*|text()"/> </fo:block> </xsl:template> <xsl:template match="h6"> <fo:block font-size="14pt" line-height="17pt" keep-with-next="always" space-after="12pt" font-family="serif" font-style="italic" text-decoration="underline"> <xsl:attribute name="id"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsltherwise> <xsl:value-of select="generate-id()"/> </xsltherwise> </xsl:choose> </xsl:attribute> <xsl:apply-templates select="*|text()"/> </fo:block> </xsl:template> |
1 2 3 4 5 6 7 8 9 10 11 12 | <xsl:attribute name="id"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsltherwise> <xsl:value-of select="generate-id()"/> </xsltherwise> </xsl:choose> </xsl:attribute> |
1 2 3 | <p>Here's a short paragraph.</p> <hr/> <p>Here's another paragraph, following a horizontal rule.</p> |
1 2 3 4 5 6 7 8 9 | <fo:block> Here's a short paragraph. </fo:block> <fo:block> <fo:leader leader-pattern="rule"/> </fo:block> <fo:block> Here's another paragraph, following a horizontal rule. </fo:block> |
1 2 3 4 5 6 7 | <xsl:template match="hr"> <fo:block> <fo:leader leader-pattern="rule"/> </fo:block> </xsl:template> |
1 | <p>Jackdaws <i>love</i> my big sphinx of quartz.</p> |
1 2 3 4 | <fo:block> Jackdaws <fo:inline font-style="italic">love</fo:inline> my big sphinx of quartz. </fo:block> |
1 2 3 4 5 6 7 | <xsl:template match="i"> <fo:inline font-style="italic"> <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 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <xsl:template match="img"> <fo:block space-after="12pt"> <fo:external-graphic src="{@src}"> <xsl:if test="@width"> <xsl:attribute name="width"> <xsl:choose> <xsl:when test="contains(@width, 'px')"> <xsl:value-of select="@width"/> </xsl:when> <xsltherwise> <xsl:value-of select="concat(@width, 'px')"/> </xsltherwise> </xsl:choose> </xsl:attribute> </xsl:if> <xsl:if test="@height"> <xsl:attribute name="height"> <xsl:choose> <xsl:when test="contains(@height, 'px')"> <xsl:value-of select="@height"/> </xsl:when> <xsltherwise> <xsl:value-of select="concat(@height, 'px')"/> </xsltherwise> </xsl:choose> </xsl:attribute> </xsl:if> </fo:external-graphic> </fo:block> </xsl:template> |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |