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 sandraB <sa...@gmail.com> on 2008/12/05 15:05:31 UTC
keep-together.within-column
Hi,
I use the keep-together.within-column attribut for the fo:table-cell to have
text wrapping. It's working fine with the text
"https://www.xxxxxxxxxx.xxxxxxxxxxxxxxx.com/xxxxxxxx/services/MultiDiffusionWS"
but it's not working with
"com.xxxxxxxxxxxxx.xxxxxxx.xxxxxxx.xxxxxxxxx.GenericDecoder".
Could you help me to resolve this issue ?
Thanks in advance.
--
View this message in context: http://www.nabble.com/keep-together.within-column-tp20854422p20854422.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: keep-together.within-column
Posted by sandraB <sa...@gmail.com>.
Hi,
Thank you everybody, it's working fine. I have really appreciated your quick
answers =) !
Sandra
Vincent Hennebert-2 wrote:
>
> Hi Sandra,
>
> sandraB wrote:
>> Hi,
>> I'm facing another issue. I keep my solution but with yours it will be
>> the
>> same problem:
>> I transform the text() node by replacing the '.' with '\u200B'. But how
>> can
>> I call the <xsl:apply-templates> on the result (I can have some bold text
>> text or italic text text in a table cell) ?
>
> I’m no XSLT specialist, but I’d play a bit more with XPath: “transform
> every text node that is a descendant of a td element”:
>
> <xsl:template match="td//text()">
> <xsl:call-template name="addZeroWidthSpace" select="."/>
> </xsl:template>
>
> If you have something like <td>Text with bold fragment</td>, the
> above template will be called 3 times: on “Text with ”, “bold” and
> “ fragment”.
>
> In the template matching td you can replace the call to
> addZeroWidthSpace with a simple <xsl:apply-templates/>.
>
>
>
>> My templates
>>
>> <xsl:template match="td">
>> <fo:table-cell overflow="visible"
>> keep-together.within-column="always">
>> <fo:block padding="0cm" white-space-collapse="false">
>> <xsl:call-template name="addZeroWidthSpace" >
>> <xsl:with-param name="str" select="text()" />
>> </xsl:call-template>
>> </fo:block>
>> </fo:table-cell>
>> </xsl:template>
>> <xsl:template name="addZeroWidthSpace">
>> <xsl:param name="str" />
>> <xsl:variable name="hyphenation-character">​</xsl:variable>
>> <xsl:choose>
>> <xsl:when test="'.' and contains($str, '.')">
>
> Why are you testing for '.'? It seems to me that you can simply do
> <xsl:when test="contains($str, '.')">
>
>> <!-- I need to apply another templates on
>> substring-before($str, '.') -->
>> <xsl:value-of select="substring-before($str, '.')" />.<xsl:value-of
>> select="$hyphenation-character" />
>> <xsl:call-template name="addZeroWidthSpace">
>> <xsl:with-param name="str" select="substring-after($str, '.')" />
>> </xsl:call-template>
>> </xsl:when>
>> <xsl:otherwise>
>> <!-- I need to apply another templates
>> here
>> -->
>> <xsl:value-of select="$str" />
>> </xsl:otherwise>
>> </xsl:choose>
>> </xsl:template>
>
> If you still have trouble getting your stylesheet right, I suggest you
> to ask on the Mulberry Tech XSL list:
> http://www.mulberrytech.com/xsl/xsl-list/index.html
> You will have more chance to find XSLT specialists who will be able to
> help you.
>
>
> HTH,
> Vincent
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/keep-together.within-column-tp20854422p20911273.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: keep-together.within-column
Posted by Vincent Hennebert <vh...@gmail.com>.
Hi Sandra,
sandraB wrote:
> Hi,
> I'm facing another issue. I keep my solution but with yours it will be the
> same problem:
> I transform the text() node by replacing the '.' with '\u200B'. But how can
> I call the <xsl:apply-templates> on the result (I can have some bold text
> text or italic text text in a table cell) ?
I’m no XSLT specialist, but I’d play a bit more with XPath: “transform
every text node that is a descendant of a td element”:
<xsl:template match="td//text()">
<xsl:call-template name="addZeroWidthSpace" select="."/>
</xsl:template>
If you have something like <td>Text with <b>bold</b> fragment</td>, the
above template will be called 3 times: on “Text with ”, “bold” and
“ fragment”.
In the template matching td you can replace the call to
addZeroWidthSpace with a simple <xsl:apply-templates/>.
> My templates
>
> <xsl:template match="td">
> <fo:table-cell overflow="visible" keep-together.within-column="always">
> <fo:block padding="0cm" white-space-collapse="false">
> <xsl:call-template name="addZeroWidthSpace" >
> <xsl:with-param name="str" select="text()" />
> </xsl:call-template>
> </fo:block>
> </fo:table-cell>
> </xsl:template>
> <xsl:template name="addZeroWidthSpace">
> <xsl:param name="str" />
> <xsl:variable name="hyphenation-character">​</xsl:variable>
> <xsl:choose>
> <xsl:when test="'.' and contains($str, '.')">
Why are you testing for '.'? It seems to me that you can simply do
<xsl:when test="contains($str, '.')">
> <!-- I need to apply another templates on
> substring-before($str, '.') -->
> <xsl:value-of select="substring-before($str, '.')" />.<xsl:value-of
> select="$hyphenation-character" />
> <xsl:call-template name="addZeroWidthSpace">
> <xsl:with-param name="str" select="substring-after($str, '.')" />
> </xsl:call-template>
> </xsl:when>
> <xsl:otherwise>
> <!-- I need to apply another templates here
> -->
> <xsl:value-of select="$str" />
> </xsl:otherwise>
> </xsl:choose>
> </xsl:template>
If you still have trouble getting your stylesheet right, I suggest you
to ask on the Mulberry Tech XSL list:
http://www.mulberrytech.com/xsl/xsl-list/index.html
You will have more chance to find XSLT specialists who will be able to
help you.
HTH,
Vincent
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: AW: AW: keep-together.within-column
Posted by sandraB <sa...@gmail.com>.
Hi,
I'm facing another issue. I keep my solution but with yours it will be the
same problem:
I transform the text() node by replacing the '.' with '\u200B'. But how can
I call the <xsl:apply-templates> on the result (I can have some bold text
text or italic text text in a table cell) ?
My templates
<xsl:template match="td">
<fo:table-cell overflow="visible" keep-together.within-column="always">
<fo:block padding="0cm" white-space-collapse="false">
<xsl:call-template name="addZeroWidthSpace" >
<xsl:with-param name="str" select="text()" />
</xsl:call-template>
</fo:block>
</fo:table-cell>
</xsl:template>
<xsl:template name="addZeroWidthSpace">
<xsl:param name="str" />
<xsl:variable name="hyphenation-character">​</xsl:variable>
<xsl:choose>
<xsl:when test="'.' and contains($str, '.')">
<!-- I need to apply another templates on
substring-before($str, '.') -->
<xsl:value-of select="substring-before($str, '.')" />.<xsl:value-of
select="$hyphenation-character" />
<xsl:call-template name="addZeroWidthSpace">
<xsl:with-param name="str" select="substring-after($str, '.')" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<!-- I need to apply another templates here
-->
<xsl:value-of select="$str" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Vincent Hennebert-2 wrote:
>
> Hi Sandra,
>
> sandraB wrote:
>> I'm using a xsl stylesheet to transform an xml file to FO file. I don't
>> know
>> exactly in which cells I can get the classnames.
>
> So that means that you don’t have a special markup for classnames? In
> which case it’s only a guess game indeed. Maybe you can use a regexp
> attempting at identifying classnames; something like
> [a-zA-Z]+\(\.[a-zA-Z]+\)*
> As to implement that in XSLT...
>
>
>> I use a template to search
>> '.' and replace it by '\u200B' but I'm facing another problem with the
>> invalid character (\). I'll update this topic when I will have the
>> solution,
>> but feel free to comment my solution.
>
> You can use the XML entity: ​
> Just put it like this in your XSLT stylesheet, and the XSLT processor
> should process it correctly.
>
>
>> Georg Datterl wrote:
>>> Hi Sandra,
>>>
>>> Basically depends how you get your data and where you manipulate it. I
>>> think, in the end the class name should look like
>>> com.\u200Bxxxxxxxxxxxxx.\u200Bxxxxxxx.\u200Bxxxxxxx.\u200Bxxxxxxxxx.\u200BGenericDecoder
>>> (in case Outlook is killing that: after each period is a unicode 200B).
>>> That should do the trick. Possibly more elegant readers can provide more
>>> elegant solutions.
>
> HTH,
> Vincent
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/keep-together.within-column-tp20854422p20895180.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: AW: AW: keep-together.within-column
Posted by Vincent Hennebert <vh...@gmail.com>.
Hi Sandra,
sandraB wrote:
> I'm using a xsl stylesheet to transform an xml file to FO file. I don't know
> exactly in which cells I can get the classnames.
So that means that you don’t have a special markup for classnames? In
which case it’s only a guess game indeed. Maybe you can use a regexp
attempting at identifying classnames; something like
[a-zA-Z]+\(\.[a-zA-Z]+\)*
As to implement that in XSLT...
> I use a template to search
> '.' and replace it by '\u200B' but I'm facing another problem with the
> invalid character (\). I'll update this topic when I will have the solution,
> but feel free to comment my solution.
You can use the XML entity: ​
Just put it like this in your XSLT stylesheet, and the XSLT processor
should process it correctly.
> Georg Datterl wrote:
>> Hi Sandra,
>>
>> Basically depends how you get your data and where you manipulate it. I
>> think, in the end the class name should look like
>> com.\u200Bxxxxxxxxxxxxx.\u200Bxxxxxxx.\u200Bxxxxxxx.\u200Bxxxxxxxxx.\u200BGenericDecoder
>> (in case Outlook is killing that: after each period is a unicode 200B).
>> That should do the trick. Possibly more elegant readers can provide more
>> elegant solutions.
HTH,
Vincent
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: AW: AW: keep-together.within-column
Posted by sandraB <sa...@gmail.com>.
I'm using a xsl stylesheet to transform an xml file to FO file. I don't know
exactly in which cells I can get the classnames. I use a template to search
'.' and replace it by '\u200B' but I'm facing another problem with the
invalid character (\). I'll update this topic when I will have the solution,
but feel free to comment my solution.
Georg Datterl wrote:
>
> Hi Sandra,
>
> Basically depends how you get your data and where you manipulate it. I
> think, in the end the class name should look like
> com.\u200Bxxxxxxxxxxxxx.\u200Bxxxxxxx.\u200Bxxxxxxx.\u200Bxxxxxxxxx.\u200BGenericDecoder
> (in case Outlook is killing that: after each period is a unicode 200B).
> That should do the trick. Possibly more elegant readers can provide more
> elegant solutions.
>
> Regards,
>
> Georg Datterl
>
> ------ Kontakt ------
>
> Georg Datterl
>
> Geneon media solutions gmbh
> Gutenstetter Straße 8a
> 90449 Nürnberg
>
> HRB Nürnberg: 17193
> Geschäftsführer: Yong-Harry Steiert
>
> Tel.: 0911/36 78 88 - 26
> Fax: 0911/36 78 88 - 20
>
> www.geneon.de
>
> Weitere Mitglieder der Willmy MediaGroup:
>
> IRS Integrated Realization Services GmbH: www.irs-nbg.de
> Willmy PrintMedia GmbH: www.willmy.de
> Willmy Consult & Content GmbH: www.willmycc.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/keep-together.within-column-tp20854422p20892434.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
AW: AW: keep-together.within-column
Posted by Georg Datterl <ge...@geneon.de>.
Hi Sandra,
Basically depends how you get your data and where you manipulate it. I think, in the end the class name should look like com.\u200Bxxxxxxxxxxxxx.\u200Bxxxxxxx.\u200Bxxxxxxx.\u200Bxxxxxxxxx.\u200BGenericDecoder (in case Outlook is killing that: after each period is a unicode 200B).
That should do the trick. Possibly more elegant readers can provide more elegant solutions.
Regards,
Georg Datterl
------ Kontakt ------
Georg Datterl
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert
Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
www.geneon.de
Weitere Mitglieder der Willmy MediaGroup:
IRS Integrated Realization Services GmbH: www.irs-nbg.de
Willmy PrintMedia GmbH: www.willmy.de
Willmy Consult & Content GmbH: www.willmycc.de
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: AW: keep-together.within-column
Posted by sandraB <sa...@gmail.com>.
Hi,
Could you give me an example please ?
Georg Datterl wrote:
>
> Hi Sandra,
>
> Most likely the hyphenation method doesn't know where to insert a break.
> This was discussed on the developer list recently and the suggestion was
> to insert zero-width spaces. If you know exactly in which cells you can
> get the classnames, maybe you can replace all . with .+zero width space?
>
> Regards,
>
> Georg Datterl
>
> ------ Kontakt ------
>
> Georg Datterl
>
> Geneon media solutions gmbh
> Gutenstetter Straße 8a
> 90449 Nürnberg
>
> HRB Nürnberg: 17193
> Geschäftsführer: Yong-Harry Steiert
>
> Tel.: 0911/36 78 88 - 26
> Fax: 0911/36 78 88 - 20
>
> www.geneon.de
>
> Weitere Mitglieder der Willmy MediaGroup:
>
> IRS Integrated Realization Services GmbH: www.irs-nbg.de
> Willmy PrintMedia GmbH: www.willmy.de
> Willmy Consult & Content GmbH: www.willmycc.de
> -----Ursprüngliche Nachricht-----
> Von: sandraB [mailto:sandra.bogaert@gmail.com]
> Gesendet: Freitag, 5. Dezember 2008 15:06
> An: fop-users@xmlgraphics.apache.org
> Betreff: keep-together.within-column
>
>
> Hi,
> I use the keep-together.within-column attribut for the fo:table-cell to
> have text wrapping. It's working fine with the text
> "https://www.xxxxxxxxxx.xxxxxxxxxxxxxxx.com/xxxxxxxx/services/MultiDiffusionWS"
> but it's not working with
> "com.xxxxxxxxxxxxx.xxxxxxx.xxxxxxx.xxxxxxxxx.GenericDecoder".
> Could you help me to resolve this issue ?
> Thanks in advance.
> --
> View this message in context:
> http://www.nabble.com/keep-together.within-column-tp20854422p20854422.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/keep-together.within-column-tp20854422p20854618.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
AW: keep-together.within-column
Posted by Georg Datterl <ge...@geneon.de>.
Hi Sandra,
Most likely the hyphenation method doesn't know where to insert a break. This was discussed on the developer list recently and the suggestion was to insert zero-width spaces. If you know exactly in which cells you can get the classnames, maybe you can replace all . with .+zero width space?
Regards,
Georg Datterl
------ Kontakt ------
Georg Datterl
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert
Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
www.geneon.de
Weitere Mitglieder der Willmy MediaGroup:
IRS Integrated Realization Services GmbH: www.irs-nbg.de
Willmy PrintMedia GmbH: www.willmy.de
Willmy Consult & Content GmbH: www.willmycc.de
-----Ursprüngliche Nachricht-----
Von: sandraB [mailto:sandra.bogaert@gmail.com]
Gesendet: Freitag, 5. Dezember 2008 15:06
An: fop-users@xmlgraphics.apache.org
Betreff: keep-together.within-column
Hi,
I use the keep-together.within-column attribut for the fo:table-cell to have text wrapping. It's working fine with the text "https://www.xxxxxxxxxx.xxxxxxxxxxxxxxx.com/xxxxxxxx/services/MultiDiffusionWS"
but it's not working with
"com.xxxxxxxxxxxxx.xxxxxxx.xxxxxxx.xxxxxxxxx.GenericDecoder".
Could you help me to resolve this issue ?
Thanks in advance.
--
View this message in context: http://www.nabble.com/keep-together.within-column-tp20854422p20854422.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org