2011-02-25 79 views
0

我真的很喜歡XSL-FO,並且我開始着手開始設計這些文檔的樣式,但我有一陣腦力凍結,試圖模仿清單。嘗試在XSL-FO中設置僞嵌套列表的樣式

我必須使用的XML不使用DITA列表,我們不得不將它變成XPP,然後轉到網絡,然後轉移到SDL的LiveContent。

這是標記我有一個列表:

<p outputclass="LC NText"><b>[12]</b>&#x00A0;&#x00A0;&#x00A0;On 24&#x00A0;October 2006, following a second CMC on 23&#x00A0;October 2006, XXXXXX, by this stage legally represented, made its application for disclosure. The application requests disclosure of the following documents:</p> 
<p outputclass="LC"><ph outputclass="NList1_num">(a)</ph><ph outputclass="NList1_text">the minute of the case review meeting;</ph></p> 
<p outputclass="LC"><ph outputclass="NList1_num">(b)</ph><ph outputclass="NList1_text">Mr&#x00A0;Mayock&#x2019;s memorandum regarding his review of the case;</ph></p> 
<p outputclass="LC"><ph outputclass="NList1_num">(c)</ph><ph outputclass="NList1_text">Mr&#x00A0;Priddis&#x2019; memorandum;</ph></p> 
<p outputclass="LC"><ph outputclass="NList1_num">(d)</ph><ph outputclass="NList1_text">the final draft of the case closure letter to be sent by Mr&#x00A0;Mayock;</ph></p> 
<p outputclass="LC"><ph outputclass="NList1_num">(e)</ph><ph outputclass="NList1_text">the draft summary of final comments from interested parties received in connection with the OFT&#x2019;s provisional decision to close its investigations.</ph></p> 

我需要縮進OutputClass類=「NList1_num」和OutputClass類=「NList1_text」規定量(我們也有NLIST * _哪裏*爲2,3,4等進一步縮進嵌套列表)。

我想:

<xsl:template match="*[contains(@outputclass,'NList1_')]"> 
     <fo:block text-indent="2em"> 
     <fo:inline background-color="red"> 
      <xsl:apply-templates/> 
     </fo:inline> 
     </fo:block> 
    </xsl:template> 

但這顯示它與NList1_num縮進在一行,並與下一行相同縮進NList1_text。我希望他們都在正常列表的同一行上。

我試過fo:inline,但發現我無法對這些應用縮進或邊距,只好使用fo:block代替。

有人可以給我一些想法如何讓這些風格。

非常感謝(再次)。

赫德利·菲利普斯

+0

您應該與外部'p'匹配作爲列表項目。 – 2011-02-25 17:39:09

回答

1

建議的方法:

  1. 創建一個小文件,用手,包含您所需要的XSL-FO標記。使用的available list constructs

    • FO:單塊
    • FO:列表項
    • FO:列表項體
    • FO:列表項標籤
  2. 當你有一些工作時,開始開發產生所需標記的樣式表。

+0

感謝您的意見,但我仍然無法獲得這個。我能得到的最接近的是,如果我將_num和_text放在fo:block中,但是我無法將它們都放在一行上。第二個塊總是將下一行放下。是否可以設置塊寬度並將它們留在css中? – 2011-03-01 09:54:04

+0

典型的,發佈後的幾秒鐘我認爲我有它。我在_text上使用margin-top =「 - 12pt」將它向上移動,以便與_num內聯 – 2011-03-01 10:27:54

+0

@Hedley:好的,如果它有效,那太棒了。但我確實認爲用fo:block來「模擬」列表而不是使用合適的格式化對象是很奇怪的。 – mzjn 2011-03-01 18:14:26