我想嘗試一個小列表的兩列布局。我複製了現有的簡單頁面主,並添加了column-count="2"
。 (爲簡潔起見,我不包括頁眉或頁腳)。如果刪除fo:page-sequence
和fo:flow
,模板將按預期工作,但否則我在輸出中沒有任何內容。我嘗試用numIndex替換另一個模板,但也失敗了。fo:page-sequence兩列沒有出現在輸出XSL-FO
我正在使用天線之家。一如往常,我很欣賞任何建議。
<fo:simple-page-master master-name="body-page-two-col" xsl:use-attribute-sets="odd-page-atts">
<fo:region-body region-name="region-body" xsl:use-attribute-sets="body-atts" column-count="2"/>
</fo:simple-page-master>
<xsl:attribute-set name="odd-page-atts">
<xsl:attribute name="page-height">11in</xsl:attribute>
<xsl:attribute name="page-width">8.5in</xsl:attribute>
<xsl:attribute name="margin-top">1.5pc</xsl:attribute>
<xsl:attribute name="margin-bottom">1.5pc</xsl:attribute>
<xsl:attribute name="margin-left">1in</xsl:attribute>
<xsl:attribute name="margin-right">.5in</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body-atts">
<xsl:attribute name="margin-top">4.5pc</xsl:attribute>
<xsl:attribute name="margin-bottom">4.5pc</xsl:attribute>
</xsl:attribute-set>
<xsl:template name="numIndex">
<fo:page-sequence master-reference="body-page-two-col" initial-page-number="auto" format="1">
<fo:flow flow-name="region-body">
<fo:block>
<fo:table-and-caption>
<fo:table-caption>
<fo:block>
<xsl:text>Numerical Index</xsl:text>
</fo:block>
</fo:table-caption>
<fo:table>
<xsl:attribute name="id"><xsl:apply-templates select="ancestor::dmodule/identAndStatusSection/dmAddress/dmIdent/dmCode"/><xsl:text>tbl-numidx001</xsl:text></xsl:attribute>
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block font-size="11pt" font-style="italic" >
<fo:retrieve-table-marker retrieve-class-name="continued-ni" retrieve-boundary-within-table="table"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:marker marker-class-name="continued-ni"/>
<fo:marker marker-class-name="continued-ni">
<fo:block text-align="center">Numerical Index  (Continued)
</fo:block>
</fo:marker>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:table border-bottom="solid" border-bottom-width=".5pt"
border-top="solid" border-top-width=".5pt" font-size="8pt"
margin-bottom="8pt" margin-left="3pt" margin-right="3pt" margin-top="8pt"
relative-position="static" space-after.maximum="12pt" space-after.minimum="12pt"
space-after.optimum="12pt" space-before.maximum="14pt" space-before.minimum="12pt"
space-before.optimum="12pt" span="all" table-layout="fixed" table-omit-header-at-break="false"
table-omit-footer-at-break="true" text-align="start" white-space-treatment="preserve"
width="3.0in" hyphenate="true" cols="4">
<fo:table-column column-number="1" column-width="30%"/>
<fo:table-column column-number="2" column-width="20%"/>
<fo:table-column column-number="3" column-width="20%"/>
<fo:table-column column-number="4" column-width="20%"/>
<fo:table-header>
<xsl:call-template name="NI-HEADER"/>
</fo:table-header>
<fo:table-body>
<xsl:call-template name="SortParts"/>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-and-caption>
</fo:flow>
</fo:block>
</fo:page-sequence>
</xsl:template>
這是什麼叫numIndex:
<xsl:template match="illustratedPartsCatalog">
<xsl:apply-templates />
<xsl:call-template name="numIndex"/>
</xsl:template>
事實上,託尼,這是我想要的,索引表現在兩列。我需要跨越標題和持續的標記,但我想我可以弄明白。我正要嘗試實現這個[http://stackoverflow.com/questions/2461866/xsl-list-divided-into-columns](http://stackoverflow.com/questions/2461866/xsl-list-divided-入列),但雙列容器正在爲我工作。謝謝! – Caroline
關於'fo:simple-page-master'的語法不正確? 'fo:simple-page-master'與其他頁面集合(從主.xsl文件中調用)是分開的文件,我不打算使用'fo:page-sequence-master'和頁眉和頁腳,直到我有兩列的格式工作。 – Caroline
問題不在於語法,而在於標記的位置。由於'fo:simple-page-master'似乎不在任何'xsl:template'之外,因此它不會在結果文檔中結束。對於任何'xsl:stylesheet'子元素的非XSLT元素也是如此,所以它與XSL-FO標記的正確性無關。 –