On 4/4/2014 8:21 PM, a3leggeddog wrote:
Thanks for the quick response!
Yes, if you have examples, that would be great. You wouldn't happen to have
an XSLT example? The one I have produces XML-FO that looks like this:
<fo:list-block space-before="1em" space-after="1em"
role="html:ul">
<fo:list-item relative-align="baseline"
provisional-distance-between-starts="0.3cm"
provisional-label-separation="0.3cm" role="html:li"><fo:list-item-label
end-indent="label-end()" text-align="end"
wrap-option="no-wrap"><fo:block><fo:inline font="1em
serif">•</fo:inline></fo:block></fo:list-item-label><fo:list-item-body
start-indent="body-start()" text-indent="0"><fo:block>Item
Number1</fo:block></fo:list-item-body></fo:list-item>
<fo:list-block space-before="1em" space-after="1em"
role="html:ul">
<fo:list-item relative-align="baseline"
provisional-distance-between-starts="0.3cm"
provisional-label-separation="0.3cm" role="html:li"><fo:list-item-label
end-indent="label-end()" text-align="end"
wrap-option="no-wrap"><fo:block><fo:inline font="0.67em monospace"
baseline-shift="0.25em">o</fo:inline></fo:block></fo:list-item-label><fo:list-item-body
start-indent="body-start()" text-indent="0"><fo:block>Sub-Item
1</fo:block></fo:list-item-body></fo:list-item>
<fo:list-item relative-align="baseline"
provisional-distance-between-starts="0.3cm"
provisional-label-separation="0.3cm" role="html:li"><fo:list-item-label
end-indent="label-end()" text-align="end"
wrap-option="no-wrap"><fo:block><fo:inline font="0.67em monospace"
baseline-shift="0.25em">o</fo:inline></fo:block></fo:list-item-label><fo:list-item-body
start-indent="body-start()" text-indent="0"><fo:block>Sub-Item
2</fo:block></fo:list-item-body></fo:list-item>
</fo:list-block>
</fo:list-block>
The XSL looks like this:
<xsl:template match="html:ul">
<fo:list-block xsl:use-attribute-sets="ul">
<xsl:call-template name="process-common-attributes-and-children"/>
</fo:list-block>
</xsl:template>
<xsl:template match="html:li//html:ul">
<fo:list-block xsl:use-attribute-sets="ul-nested">
<xsl:call-template name="process-common-attributes-and-children"/>
</fo:list-block>
</xsl:template>
<xsl:template match="html:ol">
<fo:list-block xsl:use-attribute-sets="ol">
<xsl:call-template name="process-common-attributes-and-children"/>
</fo:list-block>
</xsl:template>
<xsl:template match="html:li//html:ol">
<fo:list-block xsl:use-attribute-sets="ol-nested">
<xsl:call-template name="process-common-attributes-and-children"/>
</fo:list-block>
</xsl:template>
<xsl:template match="html:ul/html:li">
<fo:list-item xsl:use-attribute-sets="ul-li">
<xsl:call-template name="process-ul-li"/>
</fo:list-item>
</xsl:template>
<xsl:template name="process-ul-li">
<xsl:call-template name="process-common-attributes"/>
<fo:list-item-label end-indent="label-end()" text-align="end"
wrap-option="no-wrap">
<fo:block>
<xsl:variable name="depth" select="count(ancestor::html:ul)"/>
<xsl:choose>
<xsl:when test="$depth = 1">
<fo:inline xsl:use-attribute-sets="ul-label-1">
<xsl:value-of select="$ul-label-1"/>
</fo:inline>
</xsl:when>
<xsl:when test="$depth = 2">
<fo:inline xsl:use-attribute-sets="ul-label-2">
<xsl:value-of select="$ul-label-2"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<fo:inline xsl:use-attribute-sets="ul-label-3">
<xsl:value-of select="$ul-label-3"/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()" text-indent="0">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</xsl:template>
It was seemingly designed for nested lists, so I'm not sure if it's just an
issue with FOP.
Best,
Seth
Hi, Seth-
It looks like nesting is the problem. In the output above, the inner
<fo:list-block> is a direct descendant of the outer <fo:list-block>.
I'd try moving it to within the <fo:list-item-body> of the immediately
preceding <fo:list-item>.
-Terence Bandoian
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org