2011-02-25 80 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