曝光臺 注意防騙
網曝天貓店富美金盛家居專營店坑蒙拐騙欺詐消費者
• page-master-last-odd
• page-master-name
• page-master-odd
• page-master-repeating
• page-width
• pause
• pause-after
• pause-before
• pitch
• pitch-range
• play-during
• position
• precedence
• provisional-distance-between-starts
• provisional-label-separation
• reference-orientation
• ref-id
• richness
• right
• row-height
• rule-orientation
• rule-style
• rule-thickness
• scale
• score-spaces
• script
• sequence-src
• show-destination
• size
• space-above-destination-block
• space-above-destination-start
• space-after
• space-before
• space-between-list-rows
XML 實用大全
第 541 頁
• space-end
• space-start
• span
• speak
• speak-header
• speak-numeral
• speak-punctuation
• speech–rate
• start-indent
• starts-row
• state
• stress
• switch-to
• table-height
• table-layout
• table-omit-middle-footer
• table-omit-middle-header
• table-width
• text-align
• text-align-last
• text-decoration
• text-indent
• text-shadow
• text-transform
• title
• top
• vertical-align
• visibility
• voice-family
• volume
• white-space-treatment
• widows
• width
• word-spacing
• wrap-option
• writing-mode
• z-index
15.2.3 轉換成格式化對象
XSL 格式化對象是用于在頁面上排列元素的一個完整的XML 符號集。使用XSL 格式化對象的文檔只是使用此符號集的結構整
潔的XML 文檔。這意味著它有XML 聲明、根元素、子元素等等。它必須遵從任何XML 文檔的所有結構整潔的規則,否則格式
化程序就不接受它。出于習慣,含有XSL 格式化對象的文件要有.fob 這三個字符作后綴。但是,由于它還是一個結構整潔
的XML 文件,所以很可能以.xml 作后綴。
XML 實用大全
第 542 頁
清單15-1 為一用XSL 格式化對象來標記的簡單文檔。文檔的根元素為fo:root。此元素含有一個fo:layout-master-set 和
一個fo:page-sequence。fo:layout-master-set 元素包含fo:simple-page-master 子元素。每個fo:simple-page-master
描述了用來放置內容的一類頁面。其中只有一頁非常簡單的頁面,但更復雜的文檔可以有不同的主控頁,用于第一頁、右頁、
左頁、正文頁、封面內容、封底內容等等;每個文檔又可能有一系列不同的頁邊距、頁號以及其他特征。
使用fo:page-sequence 可將內容放在主控頁的許多副本上。fo:page-sequence 包含fo:sequence-specification,指定不
同的主控頁應使用的順序。其次,它還含有fo:flow 子元素,此子元素保留以指定的序列放置在主控頁上的實際內容。這里
的內容是以兩個fo:block 子元素給出,而每個子元素的font-size 屬性值為20 磅,font-family 屬性值為serif。
清單15-1:使用XSL 格式化對象符號集的簡單文檔
<fo:root xmlns:fo="http://www.w3.org/XSL/Format/1.0">
<fo:layout-master-set>
<fo:simple-page-master page-master-name="only">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout master-set>
<fo:page-sequence>
<fo:sequence-specification>
<fo:sequence-specifier-single page-master-name="only"/>
</fo:sequence-specification>
<fo:flow>
<fo:block font-size="20pt" font-family="serif">
Hydrogen
</fo:block>
<fo:block font-size="20pt" font-family="serif">
Helium
</fo:block>
</fo:flow>
</fo:page sequence>
XML 實用大全
第 543 頁
</fo: root>
盡管也許會像清單15-1 中那樣使用手工來編寫文檔,但這會失去XML 所獲得的內容格式獨立性的所有優點。通常,應該編
寫XSL 樣式單,以便使用XSL 轉換符號集將源文檔轉換成格式化對象的符號集。使用清單15-2 的XSL 樣式單,可將前一章
中的清單14-1 轉換為清單15-1。
清單15-2:從源符號集到XSL 格式化對象的變換
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
xmlns:fo="http://www.w3.org/XSL/Format/1.0"
result-ns="fo" indent-result="yes">
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/XSL/Format/1.0">
<fo:layout-master-set>
<fo:simple-page-master page-master-name="only">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence>
<fo:sequence-specification>
中國航空網 www.k6050.com
航空翻譯 www.aviation.cn
本文鏈接地址:
XML實用大全(153)