Re: XSL - NewLine

2007-02-13 Thread Andreas L Delmelle

On Feb 14, 2007, at 01:03, Daniel Noll wrote:



(We do our own breaking by substituting  elements into  
the appropriate places before running through FOP, although it  
sounds like this attribute to make linebreaks significant may be  
cleaner.)


FWIW: I've always considered the insertion of empty blocks more like  
a FO-hack, a way to trick the processor. Very useful trick, in some  
cases though. I've seen especially creative use of it in combination  
with conditional negative space-before or space-after (a Norman Walsh/ 
Docbook idea, IIRC)


OTOH, if you /can/ do without them --i.e. there are no properties  
specified on the block, so it's only used to emulate HTML's --  
then it's always better not to use them. Reason is that the Java  
object corresponding to a fo:block is fairly large, even for empty  
blocks. The less of them, the better for the memory footprint.


On top of that, the XSL transform should become much, much simpler,  
as it becomes only a matter of adding an attribute.



Cheers,

Andreas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XSL - NewLine

2007-02-13 Thread Daniel Noll

Laurent Yaish wrote:

Why would you store data with line breaks in an XML element attribute that
way in the first place?
Sounds like instead of havin  
you

should reformat your data to be more flexible such as something like:

  value1
  value2
  value3



Depends, maybe that isn't semantically correct for their data (it isn't 
for ours either.)


For example, take something like an email body.  It has multiple lines 
so line breaks should be formatted as linebreaks in the output, but each 
line shouldn't really be treated as a separate element since they occur 
in the same chunk of content.


(We do our own breaking by substituting  elements into the 
appropriate places before running through FOP, although it sounds like 
this attribute to make linebreaks significant may be cleaner.)


Daniel

--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, AustraliaPh: +61 2 9280 0699
Web: http://nuix.com/   Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XSL - NewLine

2007-02-13 Thread Laurent Yaish

Why would you store data with line breaks in an XML element attribute that
way in the first place?
Sounds like instead of havin  you
should reformat your data to be more flexible such as something like:

  value1
  value2
  value3


Just my $.02

Laurent

On 2/13/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:



Hello,

in one of my solutions I solved the problem with the symbol font:

 

Greez

Tobias

Manuel Mall <[EMAIL PROTECTED]> wrote on 13.02.2007 14:10:35:

> On Tuesday 13 February 2007 21:52, Gregan, Miroslav wrote:
> > Thanks you for your answers
> >
> > Actually I afraid I did not ask my question clearly enough.
> > The @value which is the content of an XML File's element which
> > contains a String.
> > This String has to be formatted (a little bit if possible :-) ) with
> > new lines.
> > So that the text:
> >
> > Mister T"NewLineChar"Hannibal Smith"NewLineChar"Looping
> >
> > Where "NewLineChar" should be the expected character
> >
> > After rendering FOP will look like in PDF format to:
> >
> > Mister T
> > Hannibal Smith
> > Looping
> >
> >
> > Is it possible? Or should I find a way to use multiple blocks?
> >
> As mentioned in previous responses you need to add the linefeed
> characters to the value. However, in addition you need to set the
> property  linefeed-treatment="preserve" on the enclosing fo:block
> otherwise the linefeeds in the text will be treated like / converted to
> spaces and don't generate a line break.
>
> > Thank you.
> >
> > Miroslav
> >
> >
> Manuel
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



Re: XSL - NewLine

2007-02-13 Thread Tobias . Soloschenko
Hello,

in one of my solutions I solved the problem with the symbol font:

 

Greez

Tobias

Manuel Mall <[EMAIL PROTECTED]> wrote on 13.02.2007 14:10:35:

> On Tuesday 13 February 2007 21:52, Gregan, Miroslav wrote:
> > Thanks you for your answers
> >
> > Actually I afraid I did not ask my question clearly enough.
> > The @value which is the content of an XML File's element which
> > contains a String.
> > This String has to be formatted (a little bit if possible :-) ) with
> > new lines.
> > So that the text:
> >
> > Mister T"NewLineChar"Hannibal Smith"NewLineChar"Looping
> >
> > Where "NewLineChar" should be the expected character
> >
> > After rendering FOP will look like in PDF format to:
> >
> > Mister T
> > Hannibal Smith
> > Looping
> >
> >
> > Is it possible? Or should I find a way to use multiple blocks?
> >
> As mentioned in previous responses you need to add the linefeed 
> characters to the value. However, in addition you need to set the 
> property  linefeed-treatment="preserve" on the enclosing fo:block 
> otherwise the linefeeds in the text will be treated like / converted to 
> spaces and don't generate a line break.
> 
> > Thank you.
> >
> > Miroslav
> >
> >
> Manuel
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


Re: XSL - NewLine

2007-02-13 Thread Abel Braaksma

Manuel Mall wrote:
As mentioned in previous responses you need to add the linefeed 
characters to the value. However, in addition you need to set the 
property  linefeed-treatment="preserve" on the enclosing fo:block 
otherwise the linefeeds in the text will be treated like / converted to 
spaces and don't generate a line break.
  


Interesting. I use xsl-fo too little to be aware of that. Nice tip for 
me as well, may save a lot of work ;)


-- Abel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XSL - NewLine

2007-02-13 Thread Manuel Mall
On Tuesday 13 February 2007 21:52, Gregan, Miroslav wrote:
> Thanks you for your answers
>
> Actually I afraid I did not ask my question clearly enough.
> The @value which is the content of an XML File's element which
> contains a String.
> This String has to be formatted (a little bit if possible :-) ) with
> new lines.
> So that the text:
>
> Mister T"NewLineChar"Hannibal Smith"NewLineChar"Looping
>
> Where "NewLineChar" should be the expected character
>
> After rendering FOP will look like in PDF format to:
>
> Mister T
> Hannibal Smith
> Looping
>
>
> Is it possible? Or should I find a way to use multiple blocks?
>
As mentioned in previous responses you need to add the linefeed 
characters to the value. However, in addition you need to set the 
property  linefeed-treatment="preserve" on the enclosing fo:block 
otherwise the linefeeds in the text will be treated like / converted to 
spaces and don't generate a line break.

> Thank you.
>
> Miroslav
>
>
Manuel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XSL - NewLine

2007-02-13 Thread Abel Braaksma

Gregan, Miroslav wrote:

Thanks you for your answers

Actually I afraid I did not ask my question clearly enough.
The @value which is the content of an XML File's element which contains
a String.
This String has to be formatted (a little bit if possible :-) ) with new
lines.
So that the text:

Mister T"NewLineChar"Hannibal Smith"NewLineChar"Looping

Where "NewLineChar" should be the expected character

After rendering FOP will look like in PDF format to:

Mister T
Hannibal Smith
Looping


Is it possible? Or should I find a way to use multiple blocks?
  


Your question seemed to be about how to insert line breaks in XML. If 
you want to introduce newlines in the rendered PDF, there is no use 
whatsoever to use line breaks the way we explained to you, because this 
is treated as whitespace and handled accordingly by FOP (or any xsl-fo 
processor for that matter).


Most likely you just want to use ...

I do not understand why you want an attribute to contain \r\n as it 
whitespace has no influence on the rendering process. Perhaps you mean 
it the other way around: your source document contains some attribute 
with newlines in it and you want these newlines to be turned into 
. This is then an XSLT question and the answer depends on 
what version you use. In XSLT 2 you can do the following:



   
   etc


Your best bet for this kind of questions is the XSLT list at mulberry 
tech's: http://www.mulberrytech.com/xsl/xsl-list/index.html.


Cheers,
-- Abel Braaksma
  http://xslt.metacarpus.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: XSL - NewLine

2007-02-13 Thread Gregan, Miroslav
Thanks you for your answers

Actually I afraid I did not ask my question clearly enough.
The @value which is the content of an XML File's element which contains
a String.
This String has to be formatted (a little bit if possible :-) ) with new
lines.
So that the text:

Mister T"NewLineChar"Hannibal Smith"NewLineChar"Looping

Where "NewLineChar" should be the expected character

After rendering FOP will look like in PDF format to:

Mister T
Hannibal Smith
Looping


Is it possible? Or should I find a way to use multiple blocks?

Thank you.

Miroslav




-Original Message-
From: Abel Braaksma [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 13, 2007 10:14 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: XSL - NewLine

Just use:



or



You can also add an entity to your doctype if you tend to use this kind 
of newlines more often:


and use it as follows:
&newline;

which will be rendered as a \r\n by the serializer. Of course, you could

also use an xsl:variable to do the same.

Why do you want a \r *and* a \n? Because if you output XML (which you 
do: XSL-FO) the serializer will make sure that all \r\n will become \n. 
Which means that




is semantically equivalent with:



which means that the newline entity definition will do exactly the same 
when defined thus:


(not so when you output as text, but that is another story)

If you *have* to have both the \r and the \n in the serialized output (I

have no idea why, I think you don't) then your only bet is XSLT 2.0 
which allows you to put in late-serialization replacements with 
xsl:character-map.

Cheers,
-- Abel Braaksma


Gregan, Miroslav wrote:
> Hello all,
>  
> I need to put manually new line in a pdf document and it has to be for

> the @value field.
> I know, to put a new line I should use a new block, but Is it possible

> to put some kind of "\r\n" string into the value to format it?
>
> 
> 
> 
>
> This XSL document is used to convert an XML document to PDF with 
> either FOP 0.20.5 or 0.93 used embedded in a java 5.0 code.
>  
> Thank you for your help.
>  
> Kind regards,
>  
> Miroslav Gregan
>  
> Siemens PSE-SK KB SK2
> Dubravska cesta 4
> 84104 Bratislava
> Slovakia
>  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XSL - NewLine

2007-02-13 Thread Abel Braaksma

Just use:



or



You can also add an entity to your doctype if you tend to use this kind 
of newlines more often:



and use it as follows:
&newline;

which will be rendered as a \r\n by the serializer. Of course, you could 
also use an xsl:variable to do the same.


Why do you want a \r *and* a \n? Because if you output XML (which you 
do: XSL-FO) the serializer will make sure that all \r\n will become \n. 
Which means that





is semantically equivalent with:



which means that the newline entity definition will do exactly the same 
when defined thus:



(not so when you output as text, but that is another story)

If you *have* to have both the \r and the \n in the serialized output (I 
have no idea why, I think you don't) then your only bet is XSLT 2.0 
which allows you to put in late-serialization replacements with 
xsl:character-map.


Cheers,
-- Abel Braaksma


Gregan, Miroslav wrote:

Hello all,
 
I need to put manually new line in a pdf document and it has to be for 
the @value field.
I know, to put a new line I should use a new block, but Is it possible 
to put some kind of "\r\n" string into the value to format it?






This XSL document is used to convert an XML document to PDF with 
either FOP 0.20.5 or 0.93 used embedded in a java 5.0 code.
 
Thank you for your help.
 
Kind regards,
 
Miroslav Gregan
 
Siemens PSE-SK KB SK2

Dubravska cesta 4
84104 Bratislava
Slovakia
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XSL - NewLine

2007-02-13 Thread Stefan Heuer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Hi Miroslav,

I used:

for generating csv files.

Regards

Stefan


Gregan, Miroslav schrieb:
> Hello all,
> 
> I need to put manually new line in a pdf document and it has to be
> for the @value field.
> I know, to put a new line I should use a new block, but Is it
> possible to put some kind of "\r\n" string into the value to format it?
>
> 
> 
> 
>
> This XSL document is used to convert an XML document to PDF with
> either FOP 0.20.5 or 0.93 used embedded in a java 5.0 code.
> 
> Thank you for your help.
> 
> Kind regards,
> 
> Miroslav Gregan
> 
> Siemens PSE-SK KB SK2
> Dubravska cesta 4
> 84104 Bratislava
> Slovakia
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQFF0XUdirQ0Ts08AdMRArpcAJoCBrMUznzo0NI51vZY7+Ujszs6fgCfV6Zo
typY5uF1ctn+oPW/O3RWCWo=
=eOGB
-END PGP SIGNATURE-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



XSL - NewLine

2007-02-12 Thread Gregan, Miroslav
Hello all,
 
I need to put manually new line in a pdf document and it has to be for
the @value field.
I know, to put a new line I should use a new block, but Is it possible
to put some kind of "\r\n" string into the value to format it?




This XSL document is used to convert an XML document to PDF with either
FOP 0.20.5 or 0.93 used embedded in a java 5.0 code.
 
Thank you for your help.
 
Kind regards,
 
Miroslav Gregan
 
Siemens PSE-SK KB SK2
Dubravska cesta 4
84104 Bratislava
Slovakia