<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 431,  comments - 344,  trackbacks - 0
    在學(xué)習(xí)XSL-FO之前,你應(yīng)該已經(jīng)掌握了XMLXML命名空間的基本知識。

    1.什么是XSL-FO

    XSL-FO 是用于將結(jié)果格式化成XML數(shù)據(jù)的語言,XSL-FO全稱為(Extensible Stylesheet Language Formatting Objects:擴(kuò)展格式化對象樣式表語言),XSL-FO W3C的推薦標(biāo)準(zhǔn),XSL-FO 現(xiàn)在通常被稱為XSL

    XSL-FO 是用于格式化數(shù)據(jù)的

    XSL是一種基于XML的標(biāo)記語言,它對輸出到屏幕、紙張或其它媒體上的XML數(shù)據(jù)的格式化作了具體的描述。

    XSL-FO現(xiàn)在通常叫做XSL

    樣式化包括信息的轉(zhuǎn)換格式化。當(dāng)萬維網(wǎng)聯(lián)盟(W3C)做出第一份XSL工作草案時,它包括了XML文檔的轉(zhuǎn)換和格式化的語法。后來,W3CXSL工作組把原草案分成了以下幾塊參考標(biāo)準(zhǔn):

    l         XSLT,用于轉(zhuǎn)換XML文檔的語言

    l         XSL XSL-FO,用于格式化XML文檔的語言

    l         XPath,用于將XML文檔中的元素和屬性進(jìn)行定位的語言

    該教程剩下的部分是關(guān)于格式化XML文檔的語言的:XSL-FO,也稱為XSL

    XSL-FO是一個網(wǎng)絡(luò)標(biāo)準(zhǔn)

    20011015XSL-FO已經(jīng)成為了W3C的推薦標(biāo)準(zhǔn)。它通常被稱為XSL

    2XSL-FO文檔

    XSL-FO文檔是包含輸出信息的XML文件。它們包含了與輸出的布局和輸出的內(nèi)容相關(guān)的信息。XSL-FO文檔以擴(kuò)展名“a .fo” “a .fob” 的文件保存在文件里。XSL-FO文檔也通常以“an .xml” 擴(kuò)展名來保存。因為這樣做可以使它們能更容易被XML編輯器訪問。

    XSL-FO文檔結(jié)構(gòu)

    <?xml version="1.0" encoding="UTF-8"?>

    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
     <fo:simple-page-master master-name="A4">
        <!-- Page template goes here -->
     </fo:simple-page-master>
    </fo:layout-master-set>

    <fo:page-sequence master-reference="A4">
     <!-- Page content goes here -->
    </fo:page-sequence>

    </fo:root>

    結(jié)構(gòu)說明

    XSL-FO 文檔是XML文檔,所以必須在文檔的起始處包含一份XML聲明:

            <?xml version="1.0" encoding="UTF-8"?>

    <fo:root> 元素是XSL-FO文檔的根元素。根元素也給XSL-FO聲明了命名空間:

    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
           <!-- The full XSL-FO document goes here -->
    </fo:root>

    <fo:layout-master-set> 元素包含了一個或多個頁面模板:

    <fo:layout-master-set>
           <!-- All page templates go here -->
    </fo:layout-master-set>

    每個<fo:simple-page-master>元素包含著一個單獨(dú)的頁面模板。每個模板都包含一個獨(dú)立的名稱:

    <fo:simple-page-master master-name="A4">
           <!-- One page template goes here -->
    </fo:simple-page-master>

    一個或多個<fo:page-sequence>元素描述了頁面內(nèi)容。Master-reference 屬性指的是同名的“simple-page-master” 模板。

    <fo:page-sequence master-reference="A4">
           <!-- Page content goes here -->
    </fo:page-sequence>

    注意:事實上,master-reference = "A4" 并未真正地描述預(yù)定義頁面格式。它只是一個名稱而已。你可以隨意命名,如:"MyPage""MyTemplate" 等等這樣的名稱。

    3XSL-FO 區(qū)域

    XSL格式化模型定義了大量的矩形域(塊狀區(qū))來顯示結(jié)果。所有的結(jié)果(文本、圖片,等等)都會被格式化以后放入這些區(qū)域里,并且,它將會在目標(biāo)媒體上顯示或打印出來。讓我們進(jìn)一步看看下面的區(qū)域:

    l         Pages  頁面

    l         Regions  區(qū)域

    l         Block areas  塊狀區(qū)域

    l         Line areas  行區(qū)域

    l         Inline areas  行內(nèi)區(qū)域

    XSL-FO 頁面

    XSL-FO 結(jié)果被格式化成頁面形式。打印出來的結(jié)果通常會被寫進(jìn)很多獨(dú)立的頁面。瀏覽器的輸出的結(jié)果通常會顯示長長的一頁。XSL-FO頁面包含區(qū)域。

    XSL-FO 區(qū)域

    每張XSL-FO頁面都包含大量的區(qū)域。

    l         region-body   區(qū)域 主體(頁面的主體)

    l         region-before   區(qū)域頭部(頁面頁首)

    l         region-after  區(qū)域尾部(頁面的頁腳)

    l         region-start  區(qū)域左端(左工具條)

    l         region-end  區(qū)域右端(右工具條)

    XSL-FO 區(qū)域包含塊狀區(qū)域。

    XSL-FO 塊狀區(qū)域

    XSL-FO 塊狀區(qū)域定義了小塊狀元素(通常是以新的一行作為起始的元素),例如圖表、表格和列表。XSL-FO 塊狀區(qū)域可以包含其它的塊狀區(qū)域,但是大多數(shù)情況下,它們通常包含行區(qū)域。

    XSL-FO 行區(qū)域

    XSL-FO 行區(qū)域定義了塊狀區(qū)域內(nèi)部的文本行。XSL-FO 行區(qū)域包含行內(nèi)區(qū)域。

    XSL-FO Inline 行內(nèi)區(qū)域

    XSL-FO 行內(nèi)區(qū)域定義了行內(nèi)的文本內(nèi)容(段首粗體圓點、單字符、圖形,等等)。

    4XSL-FO 輸出

    XSL-FO <fo:flow> 元素中定義輸出結(jié)果。

    XSL-FO 頁面、流程和區(qū)域

    “塊狀區(qū)域”的內(nèi)容首先進(jìn)入“頁面”,然后再由指定的媒體輸出。XSL-FO 的輸出結(jié)果通常被嵌套在<fo:block>元素、<fo:flow>元素、以及<fo:page-sequence>元素中,具體如下:

    <fo:page-sequence>
     <fo:flow flow-name="xsl-region-body">
        <fo:block>
          <!-- Output goes here -->
        </fo:block>
     </fo:flow>
    </fo:page-sequence>

    XSL-FO 案例

    下面列舉一個關(guān)于XSL-FO的實際案例:

    <?xml version="1.0" encoding="UTF-8"?>

    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
     <fo:simple-page-master master-name="A4">
     </fo:simple-page-master>
    </fo:layout-master-set>

    <fo:page-sequence master-reference="A4">
     <fo:flow flow-name="xsl-region-body">
        <fo:block>Hello w3pop.com</fo:block>
     </fo:flow>
    </fo:page-sequence>

    </fo:root>

    上述代碼應(yīng)該輸出下述結(jié)果:

    Hello w3pop.com

    5XSL-FO 流程

    XSL-FO 將被來自<fo:flow>元素中的數(shù)據(jù)所填充。XSL-FO 使用<fo:page-sequence>元素來定義結(jié)果頁面。每個結(jié)果頁面都包含了定義頁面布局的頁面主體元素。每個結(jié)果頁面都包含一個定義輸出結(jié)果<fo:flow>元素。每個結(jié)果頁面都會按照一定順序打印(或顯示)。

    XSL-FO 流程

    XSL-FO 將被來自<fo:flow>元素中的內(nèi)容所填充。<fo:flow> 元素包含了需要在頁面上打印的所有元素。當(dāng)頁面被印滿時,相同的頁面主體元素會被反復(fù)地使用,直到所有的文本內(nèi)容都被打印出來為止。

    流程流向哪里?

    <fo:flow> 元素包含“flow-name(流程名稱)屬性。“flow-name(流程名稱)的屬性值定義了<fo:flow>元素的內(nèi)容將流向何處。所有合法值如下:

    l         xsl-region-body :流向區(qū)域主體

    l         xsl-region-before :流向區(qū)域最上端

    l         xsl-region-after :流向區(qū)域最下端

    l         xsl-region-start :流向區(qū)域左端

    l         xsl-region-end :流向區(qū)域右端

    6XSL-FO 頁面

    XSL-FO 使用名為 “Page Masters [ 頁面主體 ] ” 的頁面模板來定義頁面的布局。

    XSL-FO 頁面模板
    XSL-FO 使用名為“Page Masters [ 頁面主體 ] ” 的頁面模板來定義頁面的布局。每塊模板必須包含一個獨(dú)立的名稱:

    <fo:simple-page-master master-name="intro">
     <fo:region-body margin="5in" />
    </fo:simple-page-master>

    <fo:simple-page-master master-name="left">
     <fo:region-body margin-left="2in" margin-right="3in" />
    </fo:simple-page-master>

    <fo:simple-page-master master-name="right">
     <fo:region-body margin-left="3in" margin-right="2in" />
    </fo:simple-page-master>

    在上述案例中,三個<fo:simple-page-master>元素,定義了三塊不同的模板。每塊模板都包含不同的名稱。第一塊模板稱為“intro”,它是用于介紹頁面的模板。第二和第三塊模板稱作"left" "right"。它們是用于定義奇數(shù)頁面和偶數(shù)頁面。

    XSL-FO 頁面大小

    XSL-FO 使用下述屬性來定義頁面的尺寸:

    a)         page-width 定義了頁面的寬度

    b)        page-height 定義了頁面的高度

    XSL-FO 頁面邊界

    XSL-FO 用下述屬性來定義頁面邊界:

    a)         margin-top 定義頂邊界

    b)        margin-bottom 定義底邊界

    c)        margin-left 定義左邊界

    d)        margin-right 定義右邊界

    e)         margin 定義所有四個邊界

    XSL-FO 頁面區(qū)域

    XSL-FO 使用以下元素來定義頁面的區(qū)域:

    a)         region-body 定義主體區(qū)域

    b)        region-before 定義頂端區(qū)域(頁眉)

    c)        region-after 定義底端區(qū)域(頁腳)

    d)        region-start 定義左端區(qū)域(左端工具條)

    e)         region-end 定義右端區(qū)域(右端工具條)

    前端區(qū)域(region-before),后端區(qū)域(region-after),起始區(qū)域(region-start),終止區(qū)域(region-end)是主體區(qū)域的一部分。為了避免文本在主體區(qū)域內(nèi)溢出,主體區(qū)域的邊界尺寸至少要和上述這些區(qū)域一樣。

    Margin Top

    M
    a
    r
    g
    i
    n

    L
    e
    f
    t

    REGION BEFORE

    R
    E
    G
    I
    O
    N

    S
    T
    A
    R
    T

     

     

     

     

     

    REGION BODY

     

     

     

     

     

     

    R
    E
    G
    I
    O
    N

    E
    N
    D

    REGION AFTER

    M
    a
    r
    g
    i
    n

    R
    i
    g
    h
    t

    Margin Bottom

    XSL-FO例子

    下面列舉了一份XSL-FO文檔的部分內(nèi)容:

    <fo:simple-page-master master-name="A4"
     page-width="297mm" page-height="210mm"
     margin-top="1cm"   margin-bottom="1cm"
     margin-left="1cm" margin-right="1cm">
     <fo:region-body   margin="3cm"/>
     <fo:region-before extent="2cm"/>
     <fo:region-after extent="2cm"/>
     <fo:region-start extent="2cm"/>
     <fo:region-end    extent="2cm"/>
    </fo:simple-page-master>

    上述代碼定義了名稱為"A4"“Simple Page Master”模板。這張頁面寬297毫米,高210毫米。頁面的上下左右邊界都是1厘米。主體部分的四條邊上包含了寬為3厘米的邊界。主體的上下左右部分都是2厘米。在上述案例中,主體寬度 = 頁面自身寬度 - 左右邊界寬度 - 區(qū)域主體邊界寬度,具體如下:

           297mm - (2 x 1cm) - (2 x 3cm) = 297mm - 20mm - 60mm = 217mm.

    注意:區(qū)域(左端區(qū)域和右端區(qū)域)并不在計算范圍之內(nèi)。如同前面所說的那樣,這些區(qū)域只是主體的一部分。

    7XSL-FO 塊狀區(qū)域

    XSL-FO 結(jié)果將輸入塊狀區(qū)域。

    XSL-FO 頁面、流程 以及 塊狀區(qū)域

    “塊狀區(qū)域”的內(nèi)容首先進(jìn)入“頁面”,然后再由指定的媒體輸出。XSL-FO 的輸出結(jié)果通常被嵌套在<fo:block>元素、<fo:flow>元素、以及<fo:page-sequence>元素中,具體如下:

    <fo:page-sequence>
     <fo:flow flow-name="xsl-region-body">
        <fo:block>
          <!-- Output goes here -->
        </fo:block>
     </fo:flow>
    </fo:page-sequence>

    Block 區(qū)域?qū)傩?/span>
    塊狀區(qū)域包含矩形框內(nèi)的結(jié)果序列:

    <fo:block
     border-width="1mm">
    This block of output will have a one millimeter border around it.
    </fo:block>

    因為塊狀區(qū)域的是矩形框,它們共享很多共同的區(qū)域性質(zhì):

    l         space before and space after 最上端邊界和最下端邊界

    l         margin 邊界

    l         border 邊框

    l         padding 補(bǔ)白

    Space before [頂端空間]space after [底端空間]是用來分隔其它塊狀區(qū)域的空白空間。margin [邊界]是塊狀區(qū)域外部的空白區(qū)域。border [邊框]是矩形框的四條邊;它們可以有不同的寬度;它們也可以填充不同的顏色和背景圖片,padding [補(bǔ)白]是位于邊框和內(nèi)容區(qū)域之間的地方。content [內(nèi)容]區(qū)域包含了類似于文本、圖片、圖表等實際存在的內(nèi)容。

    塊狀區(qū)域邊界

    l         margin四邊邊界

    l         margin-top頂部邊界

    l         margin-bottom底部邊界

    l         margin-left左邊界

    l         margin-right右邊界

    塊狀區(qū)域邊框

    邊框樣式屬性:

    l         border-style邊框樣式

    l         border-before-style頂端邊框樣式

    l         border-after-style底端邊框樣式

    l         border-start-style左端邊框樣式

    l         border-end-style右端邊框樣式

    l         border-top-style (same as border-before) 頂端邊框樣式(和 border-before 相同)

    l         border-bottom-style (same as border-after) 底端邊框樣式(邊 border-after 相同)

    l         border-left-style (same as border-start) 左端邊框樣式(和 border-start 相同)

    l         border-right-style (same as border-end) 右端邊框樣式(和 border-end 相同)

    邊框顏色屬性:

    l         border-color邊框顏色

    l         border-before-color頂端邊框顏色

    l         border-after-color底端邊框顏色

    l         border-start-color左端邊框顏色

    l         border-end-color右端邊框顏色

    l         border-top-color (same as border-before) 頂端邊框顏色(和 border-before 相同)

    l         border-bottom-color (same as border-after) 底端邊框顏色(和 border-after 相同)

    l         border-left-color (same as border-start) 左端邊框顏色(和 border-start 相同)

    l         border-right-color (same as border-end) 右端邊框顏色(和 border-end 相同)

    邊框?qū)挾葘傩裕?/span>

    l         border-width邊框?qū)挾?/span>

    l         border-before-width頂端邊框?qū)挾?/span>

    l         border-after-width底端邊框?qū)挾?/span>

    l         border-start-width左端邊框?qū)挾?/span>

    l         border-end-width右端邊框?qū)挾?/span>

    l         border-top-width (same as border-before) 頂端邊框?qū)挾龋ê?/span> border-before 相同)

    l         border-bottom-width (same as border-after) 底端邊框?qū)挾龋ê?/span> border-after 相同)

    l         border-left-width (same as border-start) 左端邊框?qū)挾龋ê?/span> border-start 相同)

    l         border-right-width (same as border-end) 右端邊框?qū)挾龋ê?/span> border-end 相同)

    塊狀區(qū)域補(bǔ)白:

    l         padding補(bǔ)白

    l         padding-before頂端補(bǔ)白

    l         padding-after底端補(bǔ)白

    l         padding-start左端補(bǔ)白

    l         padding-end右端補(bǔ)白

    l         padding-top (same as padding-before) 頂端補(bǔ)白(和 padding-before 相同)

    l         padding-bottom (same as padding-after) 底端補(bǔ)白(和 padding-after 相同)

    l         padding-left (same as padding-start) 左端補(bǔ)白(和 padding-start 相同)

    l         padding-right (same as padding-end) 右端補(bǔ)白(和 padding-end 相同)

    塊狀區(qū)域背景

    l         background-color背景顏色

    l         background-image背景圖形

    l         background-repeat背景重復(fù)

    l         background-attachment (scroll or fixed) 背景滾動設(shè)置(scroll:隨頁面滾動而滾動;fixed:不隨頁面滾動而滾動)

    塊狀區(qū)域樣式屬性
    塊狀區(qū)域包含了可以單獨(dú)定義樣式的結(jié)果序列:

    <fo:block
     font-size="12pt"
     font-family="sans-serif">
    This block of output will be written in a 12pt sans-serif font.
    </fo:block>

    字體屬性:

    l         font-family字體

    l         font-weight字體粗細(xì)

    l         font-style字形

    l         font-size字體尺寸

    l         font-variant字體變量

    文本屬性:

    l         text-align文本排列

    l         text-align-last文本排列持續(xù)

    l         text-indent文本縮進(jìn)

    l         start-indent頂端縮進(jìn)

    l         end-indent底端縮進(jìn)

    l         wrap-option (defines word wrap) 嵌套選項(定義自動換行)

    l         break-before (defines page breaks) 頁面左端換行(定義頁面換行)

    l         break-after (defines page breaks) 頁面右端換行(定義頁面換行)

    l         reference-orientation (defines text rotation in 90" increments) 參考定位(定義90度內(nèi)的文本旋轉(zhuǎn))

    舉例

    <fo:block
        font-size="14pt" font-family="verdana" color="red"
        space-before="5mm" space-after="5mm">
    W3Schools
    </fo:block>

    <fo:block
        text-indent="5mm"
        font-family="verdana" font-size="12pt"
        space-before="5mm" space-after="5mm">
    At w3pop.com you will find all the Web-building tutorials you
    need, from basic HTML and XHTML to advanced XML, XSL, Multimedia
    and WAP.
    </fo:block>

    Result:
    結(jié)果

    W3Schools

       At w3pop.com you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.

    從上述案例中,你會發(fā)現(xiàn),要創(chuàng)建一份包含多個標(biāo)題和段落的文檔需要使用大量的代碼。一般情況下,XSL-FO文檔不需要將格式化信息和內(nèi)容結(jié)合起來。只需要使用XSLT的一小部分功能,我們就可以把格式化信息放入模板中,書寫一份整潔的內(nèi)容了。當(dāng)你學(xué)完這份教程之后,你就會掌握更多關(guān)于把XSL-FOXSLT模板結(jié)合起來使用的方法。

    8XSL-FO 列表

    XSL-FO用列表塊區(qū)定義列表

    XSL-FO列表區(qū)

    用于創(chuàng)建列表的XSL-FO對象有以下四個:

    l         fo:list-block (含有整個列表)

    l         fo:list-item (含有列表里的每一項)

    l        fo:list-item-label (含有列表項的標(biāo)簽,典型的例子如:一個<fo:block>元素含有一個數(shù)字,字符,等等.)

    l         fo:list-item-body (含有列表項的內(nèi)容和主體,典型的例子如:一個或多個<fo:block>對象)

    一份XSL-FO列表的例子:

    <fo:list-block>

    <fo:list-item>
     <fo:list-item-label>
       <fo:block>*</fo:block>
     </fo:list-item-label>
     <fo:list-item-body>
       <fo:block>Volvo</fo:block>
     </fo:list-item-body>
    </fo:list-item>

    <fo:list-item>

     <fo:list-item-label>
       <fo:block>*</fo:block>
     </fo:list-item-label>
     <fo:list-item-body>
       <fo:block>Saab</fo:block>
     </fo:list-item-body>
    </fo:list-item>

    </fo:list-block>

    The output from this code would be:
    這份代碼應(yīng)該輸出如下結(jié)果:

     * Volvo
     * Saab

    9XSL-FO 表格

    XSL-FO 使用<fo:table-and-caption>元素定義表格。

    XSL-FO 表格

    XSL-FO 的表格模式和HTML表格模式相差不大。下面列舉9個可以用于創(chuàng)建表格的XSL-FO對象:

    l         fo:table-and-caption

    l         fo:table

    l         fo:table-caption

    l         fo:table-column

    l         fo:table-header

    l         fo:table-footer

    l         fo:table-body

    l         fo:table-row

    l         fo:table-cell

    XSL-FO使用<fo:table-and-caption>元素來定義一張表格。它包含了一個<fo:table>元素和一個可選擇的<fo:caption>元素。<fo:table>元素包含了幾個可選擇的<fo:table-column>元素,一個可選擇的<fo:table-footer>元素。這些元素都包含一個或多個的<fo:table-row>元素以及一個或多個的<fo:table-cell>元素:

    <fo:table-and-caption>
    <fo:table>
    <fo:table-column column-width="25mm"/>
    <fo:table-column column-width="25mm"/>
    <fo:table-header>
     <fo:table-row>
        <fo:table-cell>
          <fo:block font-weight="bold">Car</fo:block>
        </fo:table-cell>
        <fo:table-cell>
          <fo:block font-weight="bold">Price</fo:block>
        </fo:table-cell>
     </fo:table-row>
    </fo:table-header>
    <fo:table-body>
     <fo:table-row>
        <fo:table-cell>
          <fo:block>Volvo</fo:block>
        </fo:table-cell>
        <fo:table-cell>
          <fo:block>$50000</fo:block>
        </fo:table-cell>
     </fo:table-row>
     <fo:table-row>
        <fo:table-cell>
          <fo:block>SAAB</fo:block>
        </fo:table-cell>
        <fo:table-cell>
          <fo:block>$48000</fo:block>
        </fo:table-cell>
     </fo:table-row>
    </fo:table-body>
    </fo:table>
    </fo:table-and-caption>

    The output from this code would something like this:
    上述代碼將輸出如下結(jié)果:

    Car

    Price

    Volvo

    $50000

    SAAB

    $48000

    10XSL-FO XSLT

    XSL-FO XSLT 可以進(jìn)行功能互補(bǔ)。

    還記得下面這個案例嗎?

    <fo:block
        font-size="14pt" font-family="verdana" color="red"
        space-before="5mm" space-after="5mm">
    W3Schools
    </fo:block>

    <fo:block
        text-indent="5mm"
        font-family="verdana" font-size="12pt"
        space-before="5mm" space-after="5mm">
    At w3pop.com you will find all the Web-building tutorials you
    need, from basic HTML and XHTML to advanced XML, XSL, Multimedia
    and WAP.
    </fo:block>

    Result:
    結(jié)果

    W3Schools

       At w3pop.com you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.

    XSLT中得到一些幫助
    從文檔中刪除XSL-FO信息的方法:

    <header>
    W3Schools
    </header>

    <paragraph>
    At W3pop.com you will find all the Web-building tutorials you
    need, from basic HTML and XHTML to advanced XML, XSL, Multimedia
    and WAP.
    </paragraph>

    Add an XSLT transformation:
    添加一條 XSLT 轉(zhuǎn)換信息的方法:

    <xsl:template match="header">
    <fo:block
        font-size="14pt" font-family="verdana" color="red"
        space-before="5mm" space-after="5mm">
        <xsl:apply-templates/>
    </fo:block>
    </xsl:template>
    <xsl:template match="paragraph">
    <fo:block
        text-indent="5mm"
        font-family="verdana" font-size="12pt"
        space-before="5mm" space-after="5mm">

        <xsl:apply-templates/>
    </fo:block>
    </xsl:template>

    And the result will be the same:
    結(jié)果仍然相同:

    W3Schools

    At W3pop.com you will find all the Web-building tutorials you need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.

    11XSL-FO 軟件

    XSL-FO 需要格式化軟件來輸出結(jié)果。

    XSL-FO 處理器

    XSL-FO 處理器是用于格式化XML文檔輸出結(jié)果的軟件程序。大多數(shù)XSL-FO 處理器可以輸出PDF文檔,并進(jìn)行高質(zhì)量的打印。當(dāng)然,它還可以HTML等其它形式輸出。下面的部分介紹一些知名的XSL-FO處理器。

    1)        XSL FormatterXSL Formatter 是一種用于格式化XML文檔的軟件,從而可以打印輸出高質(zhì)量的PDF文件。在2002年的一月,全球市場上推出了相同產(chǎn)品的V2版本。在歐洲舉辦的XML 2002, XML 2003 峰會上,XSL Formatter被公認(rèn)為品質(zhì)最佳的產(chǎn)品。在擁有4XSL-FO軟件開發(fā)經(jīng)驗的基礎(chǔ)之上,, Antenna House又從頭開發(fā)全新的Formatter。這種Formatter將增加一些更顯著實用的功能,并為將來的繼續(xù)發(fā)展提供了堅實的基礎(chǔ)。

    2)        XincXinc Lunasil 公司推出的XSL-FO處理器。Xinc的特點是:運(yùn)行速度快,多路處理,并有記憶效果。包含擺動裝置的XSL-FO閱讀器可以瀏覽和打印XSL-FO文件,只需要點擊鼠標(biāo)就可以操做PDF文件;通過XincJava APIJava應(yīng)用程序接口),Xinc可以作為服務(wù)器組件使用;通過XincCOM(串行通訊端口)分界面,它也可在Microsoft服務(wù)器環(huán)境下使用。它的新特點如下:連字符號連接、基礎(chǔ)連接、PDF輸出、內(nèi)存 / 速度最優(yōu)化和簡單的COM界面。

    3)        ScripturaInventive Designers Scriptura 是基于XSLT XSL-FO 跨平臺文檔設(shè)計器和問題處理器。Scriptura 包含一個 WYSIWYG(即見及所得)的工具和引擎。在該引擎中使用的 XSL-FO formatter 已經(jīng)不再以 Apache FOP 為基礎(chǔ)了,而是設(shè)計者們重新開始書寫。這個版本的新特點是:支持圓點、編號列表、“break-before [ 頂部換行 ]” “break-after [ 底部換行 ]” 特性;擴(kuò)展的條形碼選項、改進(jìn)的數(shù)字、貨幣格式。免費(fèi)的體驗版本可以通過下載獲取。

    XSL格式化對象參考資料

    將具體描述轉(zhuǎn)化為表達(dá)式的過程稱為格式化:

    Object
    對象

    Description
    描述

    basic-link

    Represents the start resource of a link
    頂端資源鏈接

    bidi-override

    Overrides the default Unicode BIDI direction
    忽略默認(rèn)統(tǒng)一字符編碼標(biāo)準(zhǔn)BIDI的用法

    block

    Defines a block of output (e.g. paragraphs and titles)
    定義輸出組件(比如:段落、標(biāo)題)

    block-container

    Defines a block-level reference-area
    定義一個block層次等級參考面

    character

    Specifies a character that will be mapped to a glyph for presentation
    指定將被映射為字形表達(dá)式的字符

    color-profile

    Defines a color-profile for a stylesheet
    定義樣式表的輪廓顏色

    conditional-page-master-reference

    Specifies a page-master to be used when the conditions defined are true
    當(dāng)條件為true真時,允許使用page-master [ 頁面主體 ]

    declarations

    Groups global declarations for a stylesheet
    群組一個通用的樣式

    external-graphic

    Used for a graphic where the graphics data resides outside of the XML result tree
    用于圖形數(shù)據(jù)位于XML結(jié)果樹的外部的圖形

    float

    Typically used to position an image in a separate area at the beginning of a page OR to position an image to one side, with the content flowing along-side of the image
    常用于在頁面起始處的一個單獨(dú)區(qū)域里指定一個圖形的位置,或者將內(nèi)容浮動于圖形的周圍

    flow

    Contains all elements to be printed to a page
    包含所有要打印在頁面上的元素

    footnote

    Defines a footnote within the region-body of a page
    在頁面區(qū)域主體上定義腳注

    footnote-body

    Defines the content of the footnote
    定義腳注內(nèi)容

    initial-property-set

    Formats the first line of an <fo:block>
    格式化<fo:block>元素的第一行

    inline

    Formats a part of a text with a background or enclosing it in a border
    通過背景屬性或?qū)⑵淝度胍粋€邊框來定義文本的一部分格式

    inline-container

    Defines an inline reference-area
    定義行內(nèi)參數(shù)區(qū)域

    instream-foreign-object

    Used for inline graphics or for "generic" objects where the object's data resides as descendants of <fo:instream-foreign-object>
    用于行內(nèi)圖形或類對象。在其中,對象的數(shù)據(jù)以<fo:instream-foreign-object>的孫類元素形式存在

    layout-master-set

    Holds all masters used in a document
    保留文檔中所有使用的master[ 主體 ]

    leader

    Used to generate "." to separate titles from page numbers in table of contents, or to create input fields in forms, or to create horizontal rules
    通過定義 “.” 為分割頁面中的標(biāo)題,或者建立一個表單輸入字段或一個平行法則

    list-block

    Defines a list
    定義一張列表

    list-item

    Contains each item in the list
    包含列表的每個項

    list-item-body

    Contains the content/body of the list-item
    包含列表項的內(nèi)容 / 主體

    list-item-label

    Contains the label for the list-item (typically a number, character, etc.)
    包含列表項的標(biāo)簽(一般是一個數(shù)字、字符,等等)

    marker

    Used with <fo:retrieve-marker> to create running headers or footers
    使用<fo:retrieve-marker>來創(chuàng)建運(yùn)行標(biāo)題或運(yùn)行頁腳

    multi-case

    Contains (within an <fo:multi-switch>) each alternative sub-tree of XSL-FO objects. The parent <fo:multi-switch> will choose which alternative to show and hide the rest
    在<fo:multi-switch>中,包含了每一個可用于替代XSL-FO對象的子樹的對象。父級 <fo:multi-switch> 會選擇其中一個來決定 “顯示或隱藏” 剩余的部分。

    multi-properties

    Used to switch between two or more property-sets
    用于在兩個或更多的屬性集之間進(jìn)行轉(zhuǎn)換

    multi-property-set

    Specifies an alternative property-set that will be applied depending on the state of the user agent
    根據(jù)用戶的代理狀態(tài),指定一個應(yīng)用屬性集的替代元素

    multi-switch

    Holds one or more <fo:multi-case> objects and controls the switching between them (activated by <fo:multi-toggle>)
    保留一個或多個<fo:multi-case>對象,控制它們(由 <fo:multi-toggle> 觸發(fā))彼此之間的轉(zhuǎn)換

    multi-toggle

    Used to switch to another <fo:multi-case>
    用于轉(zhuǎn)換成另一個 <fo:multi-toggle>元素

    page-number

    Represents the current page-number
    指示當(dāng)前頁碼

    page-number-citation

    References the page-number for the page that contains the first normal area returned by the cited object
    為包含由site對象所返回的第一標(biāo)準(zhǔn)區(qū)域指定頁碼

    page-sequence

    A container for page output elements. There will be one <fo:page-sequence> object for each page layout
    指定一個頁面結(jié)果元素的容器。這里,<fo:page-sequence>對象適用于所有的頁面布局

    page-sequence-master

    Specifies which simple-page-masters are to be used and in which order
    指定使用的“simple-page-masters [簡單頁面主體] ” 以及使用順序

    region-after

    Defines a page footer
    定義頁腳

    region-before

    Defines a page header
    定義頁眉

    region-body

    Defines a page body
    定義頁面主體

    region-end

    Defines the right sidebar of a page
    定義頁面右工具條

    region-start

    Defines the left sidebar of a page
    定義頁面左工具條

    repeatable-page-master-alternatives

    Specifies repetition of a set of simple-page-masters
    指定一組 “simple-page-masters” 循環(huán)

    repeatable-page-master-reference

    Specifies repetition of a single simple-page-master
    指定單個 “simple-page-masters” 循環(huán)

    retrieve-marker

    Used with <fo:marker> to create running headers or footers
    使用 <fo:marker> 創(chuàng)建運(yùn)行的標(biāo)題與頁腳

    root

    The root (top) node for XSL-FO documents
    指定XSL-FO文檔的根目錄節(jié)點

    simple-page-master

    Defines the size and shape of a page
    定義頁面的尺寸與形狀

    single-page-master-reference

    Specifies a page-master to be used at a given point in the sequence of pages
    在一個頁面序列的給定點中指定 page-master [ 頁面主體 ]

    static-content

    Contains static content (e.g. headers and footers) that will be repeated on many pages
    指定在多個頁面中重復(fù)使用或出現(xiàn)的靜態(tài)內(nèi)容(如:頁眉和頁腳)

    table

    Formats the tabular material of a table
    格式化表格的列表材料

    table-and-caption

    Formats a table and its caption
    格式化表格及其標(biāo)題

    table-body

    Container for table rows and table cells
    指定表格行和單元格的容器

    table-caption

    Contains the caption for a table
    指定表格標(biāo)題

    table-cell

    Defines a table cell
    定義一個單元格

    table-column

    Formats the columns of a table
    格式化表格列

    table-footer

    Defines a table footer
    定義表格頁腳

    table-header

    Defines a table header
    定義表格頁眉

    table-row

    Defines a table row
    定義表格行

    title

    Defines a title for a page-sequence
    定義頁面序列的標(biāo)題

    wrapper

    Specifies inherited properties for a group of XSL-FO objects
    指定XSL-FO對象組的繼承屬性

    posted on 2008-01-18 14:36 周銳 閱讀(1379) 評論(0)  編輯  收藏 所屬分類: HTMLXMLXSLT
    主站蜘蛛池模板: 亚洲免费观看视频| WWW免费视频在线观看播放| 亚洲国产精品无码久久久秋霞2| 四虎成人免费网址在线| 精品无码国产污污污免费网站 | 理论亚洲区美一区二区三区| 亚洲宅男永久在线| 亚洲日韩精品射精日| 免费一级毛片不卡不收费| 无码日韩精品一区二区免费| 无码AV片在线观看免费| 9i9精品国产免费久久| 美女视频黄频a免费大全视频| 2020亚洲男人天堂精品| 亚洲男女一区二区三区| 亚洲国产成人精品不卡青青草原| 精品国产亚洲男女在线线电影 | 久99精品视频在线观看婷亚洲片国产一区一级在线 | 亚洲AV无码精品国产成人| 国产免费网站看v片在线| 亚洲αⅴ无码乱码在线观看性色| 亚洲免费中文字幕| 亚洲精品熟女国产| 91亚洲国产成人精品下载| 亚洲国产女人aaa毛片在线| 亚洲国产精品SSS在线观看AV| 自拍偷自拍亚洲精品情侣| 妻子5免费完整高清电视| 无码人妻一区二区三区免费看 | 国产亚洲精品激情都市| 亚洲男女内射在线播放| 亚欧色视频在线观看免费| 人妻丰满熟妇无码区免费| 小草在线看片免费人成视久网| 免费污视频在线观看| 久久精品免费电影| 久久综合给合久久国产免费| 久久国产高潮流白浆免费观看| 91香蕉国产线在线观看免费| 18pao国产成视频永久免费| 精品无码免费专区毛片|