You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Ganesh Babu Nallamothu, Integra-India" <ga...@integra-india.com> on 2004/11/14 09:39:27 UTC

list overlapping

Dear All,

I am having a dl list in which the text is more.

<duoList>
<first><italic>The Cambridge Companion to Greek Tragedy</italic></first>
<second>edited by P. E. Easterling</second>
<first><italic>The Cambridge Companion to Roman Satire</italic></first>
<second>edited by Kirk Freudenburg</second>
</duoList>

This is the code for conversion this format into list. But the problem is
when you convert to PDF the <second> text is overwriting on first one. Plus
italic is not coming. When I try to adde label-end and body-start functions
it showing an error that area is full. Can anybody tell me how to solve this
problem. One option table! any other option in the list itself.


<xsl:template match="c:duoList">
  <fo:list-block>
    <xsl:for-each select="c:first">
      <fo:list-item>
        <fo:list-item-label>
          <fo:block>
            <xsl:value-of select="c:paragraph"/>
          </fo:block>
        </fo:list-item-label>
        <fo:list-item-body>
          <fo:block>
            <xsl:value-of select="../c:second/c:paragraph"/>
          </fo:block>
        </fo:list-item-body>
      </fo:list-item>
    </xsl:for-each>
  </fo:list-block>


Regards,
Ganesh


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: list overlapping

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Ganesh Babu Nallamothu, Integra-India
>

Hi,

First of all: I feel compelled to point out that what you are trying to do
and the way you seem to be going about it, is actually violating the concept
of a list-block IMHO (a two-column table seems far better suited for this).

A list-block is meant for things like:

A. Topic1
B. Topic2

Where the A. and B. correspond to the list-item-labels and Topic1 / Topic2
are the list-item-bodies.

However, if you insist...

(answering your questions a bit out of order)

> ... italic is not coming.

> <duoList>
> <first><italic>The Cambridge Companion to Greek Tragedy</italic></first>

Well, having the content in a node named 'italic' in your source XML is
obviously not going to magically add the italics to the result, unless you
have the XSLT add the necessary property to the corresponding fo:block.

>     <xsl:for-each select="c:first">
>       <fo:list-item>
>         <fo:list-item-label>
>           <fo:block>

This should at least be: <fo:block font-style="italic">

A bit more elegant maybe --certainly more 'the XSLT way', would be to have
code like:

<xsl:template match="c:italic">
  <fo:block font-style="italic">
    <xsl:apply-templates select="c:paragraph" />
  </fo:block>
</xsl:template>

That way, your original code can be rewritten as:

<xsl:for-each select="c:first">
  <fo:list-item>
    <fo:list-item-label>
      <xsl:apply-templates />
    </fo:list-item-label>
  </fo:list-item>
  ...

> ... the problem is when you convert to PDF the
> <second> text is overwriting on first one.
...
> When I try to adde label-end and body-start functions
> it showing an error that area is full.

See:
http://www.w3.org/TR/xsl/slice7.html#provisional-label-separation
and
http://www.w3.org/TR/xsl/slice7.html#provisional-distance-between-starts

excerpt:
"body-start() = the value of the start-indent
  + start-intrusion-adjustment
  + the value of the provisional-distance-between starts of the closest
     ancestor fo:list-block"

So, in short, if you want to use the label-end()/body-start() functions,
then you absolutely *need* to specify
provisional-label-separation/provisional-distance-between-starts on the
fo:list-block, or you'll get undesired results.

I think the simplest way would be to add margin-* properties to the
fo:blocks inside the body. If I recall correctly, these margins are
determined WRT to the reference-area containing the enclosing list-block, so
something like:

<fo:list-item-body>
  <fo:block margin-left="100mm">
    <xsl:value-of select="../c:second/c:paragraph"/>
  </fo:block>
</fo:list-item-body>

might be more what you need.

HTH!

Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org