-
XSL对象格式使用指南(三)
作者: 天译编译 | ||
在前两篇中我们已经讨论了怎样处理封面页和内容页,现在我们准备把以下内容放入这西班牙评论手册里。 标题和段落属性由<fo:block> 元素控制,粗体和带下划线的词语由<fo:inline>元素控制。现在开始描述第一个标题: <fo:block font-size="14pt" font-family="sans-serif" font-weight="bold" color="green" space-before="6pt" space-after="6pt"> Introduction <fo:block> space-before属性和space-after属性是储存区域中属性设置值中的两种。这些属性和层叠样式表CSS相类似 字体属性 font-family,font-weight,font-style (斜体),font-size,font-stretch,font-variant 背景属性 background-color,background-image,background-repeat,background-attachment (卷动或固定) 边界属性 border-location-info: location可以为before,after,start,,end,,top,bottom,left或right info is 可以为字体,宽度或颜色 填充属性 padding-location:` location is 可以为before,after,,start,end,top,bottom,left或right 空白属性 margin-location: location可以为top,bottom,left或right 文本排列属性 text-align和text-align-last (用作文本最后一行); 函数可以为start,end,left,right或center 缩排属性 text-indent (第一行),start-indent,end-indent 其他属性 wrap-option (没有约束或有约束);widows和orphans (决定页面的顶部或左部有多少行)break-after和break-before;reference-orientation (将正文旋转90度) 通过这些属性,我们可以明确定位一个复杂的段落。定位使用 “复合数据类型”的标点符号可以使页面的版面可以在不同的图像分辨率下自动适应: <fo:block text-indent="1em" font-family="sans-serif" font-size="12pt" space-before.minimum="2pt" space-before.maximum="6pt" space-before.optimum="4pt" space-after.minimum="2pt" space-after.maximum="6pt" space-after.optimum="4pt"> This handbook covers the major topics in Spanish, but is by no means complete. <fo:block> 如果你的文档有很多标题或段落时,你不需要将所有的文档逐一格式化。有XSLT ,我们能用XSLT把文档写入HTML 或转换成详细的XSL:FO 译本。以下是已经转换好的HTML : <h3>Introduction</h3> <p> This handbook covers the major topics in Spanish, but is by no means complete. </p> <h3>Accents</h3> <p> When we pronounce English words, one syllable is usually emphasized (<b>stressed</b>, in linguistic terms). The stressed syllable is underlined in the following words: com<u>pu</u>ter,<u>lan</u>guage, de<u>vel</u>opment, suc<u>ceeds</u>. Spanish words also have a stressed syllable, and there are rules for determining which syllable carries the emphasis. </p> 下边是标题和段落的模板: <xsl:template match="h3"> <fo:block font-size="14pt" font-family="sans-serif" font-weight="bold" color="green" space-before="6pt" space-after="6pt"> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="p"> <fo:block text-indent="1em" font-family="sans-serif" font-size="12pt" space-before.minimum="2pt" space-before.maximum="6pt" space-before.optimum="4pt" space-after.minimum="2pt" space-after.maximum="6pt" space-after.optimum="4pt"> <xsl:apply-templates/> </fo:block> </xsl:template> 在这篇文章初始化时已经设定了模板并将<html>和 <body>标记了,我们在这时不用再重复,只需用浏览器检查一下。 这是文档的树结构。用<b> 和 <u> 标记了最后一个子接点。它们在行列中的句柄为<fo:inline>元素。 <xsl:template match="b"> <fo:inline font-weight="bold"> <xsl:apply-templates/> </fo:inline> </xsl:template> <xsl:template match="u"> <fo:inline text-decoration="underline"> <xsl:apply-templates/> </fo:inline> </xsl:template> <xsl:template match="i"> <fo:inline font-style="italic"> <xsl:apply-templates/> </fo:inline> </xsl:template> |
栏目列表
最新更新
求1000阶乘的结果末尾有多少个0
详解MyBatis延迟加载是如何实现的
IDEA 控制台中文乱码4种解决方案
SpringBoot中版本兼容性处理的实现示例
Spring的IOC解决程序耦合的实现
详解Spring多数据源如何切换
Java报错:UnsupportedOperationException in Col
使用Spring Batch实现批处理任务的详细教程
java中怎么将多个音频文件拼接合成一个
SpringBoot整合ES多个精确值查询 terms功能实
数据库审计与智能监控:从日志分析到异
SQL Server 中的数据类型隐式转换问题
SQL Server中T-SQL 数据类型转换详解
sqlserver 数据类型转换小实验
SQL Server数据类型转换方法
SQL Server 2017无法连接到服务器的问题解决
SQLServer地址搜索性能优化
Sql Server查询性能优化之不可小觑的书签查
SQL Server数据库的高性能优化经验总结
SQL SERVER性能优化综述(很好的总结,不要错
uniapp/H5 获取手机桌面壁纸 (静态壁纸)
[前端] DNS解析与优化
为什么在js中需要添加addEventListener()?
JS模块化系统
js通过Object.defineProperty() 定义和控制对象
这是目前我见过最好的跨域解决方案!
减少回流与重绘
减少回流与重绘
如何使用KrpanoToolJS在浏览器切图
performance.now() 与 Date.now() 对比