0
votes

I have a requirement that , there is name of person present in <fo:table-block> under the <fo:table-cell> , if the lenth of name exceed from spacified lenth then this should be brake in two ore more lines. The name is coming from a form so its length can be vary , for example I can have name having length maximum 30 character.

Any Idea how to achive this ?

my xml is :

<sign><sign1 naam='R.M.L.H.V.U. van RammanohatLohiaji' 
date='20 march 2014'></Sign>
<Sign1 naam='A.S.D.F.G.H. van RammanohatLohiaji' 
date='20 maart 2014'></sign>

My xslt is:

        <fo:table table-layout="fixed" width="100%">
            <fo:table-column column-width="60mm" />
            <fo:table-column column-width="60mm" />
            <fo:table-column column-width="60mm" />

            <fo:table-body>
                <fo:table-row>
                    <xsl:for-each select="sign">
                        <fo:table-cell width="90mm">
                            <fo:block font-size="12pt" font-weight="bold">
                                Signature                               </fo:block>
                            <fo:block space-after="1cm" font-size="11pt" font-weight="bold">
                                <xsl:value-of select="@sign1" />
                            </fo:block>
                            <fo:block space-after="1cm" >
                                Date <xsl:value-of select="@date" />
                            </fo:block>

                            <!-- <fo:list-block space-after="1cm">
                                <xsl:call-template name="labelvalue">
                                    <xsl:with-param name="label">

                                    </xsl:with-param>
                                    <xsl:with-param name="value" select="@date" />
                                </xsl:call-template>
                            </fo:list-block> -->
                            <fo:block >
                            Signature <fo:leader leader-pattern="rule" leader-length="3.2cm" />
                            </fo:block>
                        </fo:table-cell>
                    </xsl:for-each>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </fo:block-container>
</xsl:template>
1
It is very unclear what you are asking. Please include your XML input, your XSLT stylesheet and the XSL-FO output you expect vs. the one you actually get. - Mathias Müller
I want to breake the sign1 into two lines. - Sai prateek

1 Answers

1
votes

Your question is not really clear so I had to make a wild guess. In general, you can "break up the content" by:

  • having more than one fo:block. Every block is rendered on a new line because it indicates a new paragraph.
  • actively inserting line breaks (or linefeeds)

For example:

<fo:block>Text content before line feed&#10;Text content after it</fo:block>

Make sure that these characters are actually preserved, there are block attributes for this (white-space-treatment, linefeed-treatment and others).