1 2 | <p>Einstein's famous e=mc<sup>2</sup> is an equation that changed the world. </p> |
1 2 3 4 5 6 7 8 | <xsl:template match="sup"> <fo:inline vertical-align="super" font-size="75%"> <xsl:apply-templates select="*|text()"/> </fo:inline> </xsl:template> |
1 | <table cols="200 100pt" border="1"> |
1 2 | <fo:table-column column-width="200pt"/> <fo:table-column column-width="100pt"/> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <xsl:template match="table"> <fo:table table-layout="fixed"> <xsl:choose> <xsl:when test="@cols"> <xsl:call-template name="build-columns"> <xsl:with-param name="cols" select="concat(@cols, ' ')"/> </xsl:call-template> </xsl:when> <xsltherwise> <fo:table-column column-width="200pt"/> </xsltherwise> </xsl:choose> <fo:table-body> <xsl:apply-templates select="*"/> </fo:table-body> </fo:table> </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 | <xsl:template name="build-columns"> <xsl:param name="cols"/> <xsl:if test="string-length(normalize-space($cols))"> <xsl:variable name="next-col"> <xsl:value-of select="substring-before($cols, ' ')"/> </xsl:variable> <xsl:variable name="remaining-cols"> <xsl:value-of select="substring-after($cols, ' ')"/> </xsl:variable> <xsl:choose> <xsl:when test="contains($next-col, 'pt')"> <fo:table-column column-width="{$next-col}"/> </xsl:when> <xsl:when test="number($next-col) > 0"> <fo:table-column column-width="{concat($next-col, 'pt')}"/> </xsl:when> <xsltherwise> <fo:table-column column-width="50pt"/> </xsltherwise> </xsl:choose> <xsl:call-template name="build-columns"> <xsl:with-param name="cols" select="concat($remaining-cols, ' ')"/> </xsl:call-template> </xsl:if> </xsl:template> |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |