Linebreak question
Posted: Fri Feb 25, 2005 1:37 pm
Here's a tough one.... (I'm a little new at this so bear with me)...
I have some XML that looks something like this:
When I transform to HTML I get this:
which is what I want.
When I convert to PDF (using Docbook as an intermediate step) I either get:
or
All on one line isn't much help, and the extra spacing is also not a solution that works.
Docbook doesn't have any way to handle the BR tag in the way it's handled in HTML (according to their documentation). I could use the <literallayout> tag, but this presents all new problems since the BR tag is used in the XML in places I can't or don't want to use the <literallayout> (because it also respects the spacing in addition to the hard returns).
I've tried using <literallayout> with just a hard return as a subset of the <para> tag (using teh xsl to look for the <br/> tag and insert the <literallayout> wrapping a hard return), but I get the extra "paragraph" spacing I don't want....
So.. does anyone have any suggestions for what I could try or use to insert a linebreak in the Docbook text. If I'm up against a "you can't do this" situation, I'm willing to adjust my XML and make a new tag for the instances I want the BR and map that specifically to the <literallayout> tag in the xsl... but I figure it's worth asking before I do this...
I have some XML that looks something like this:
Code: Select all
<p>text1<br/>
text2<br/>
text3</p>
Code: Select all
text1
text2
text3
When I convert to PDF (using Docbook as an intermediate step) I either get:
Code: Select all
text1 text2 text3
Code: Select all
text1
text2
text3
Docbook doesn't have any way to handle the BR tag in the way it's handled in HTML (according to their documentation). I could use the <literallayout> tag, but this presents all new problems since the BR tag is used in the XML in places I can't or don't want to use the <literallayout> (because it also respects the spacing in addition to the hard returns).
I've tried using <literallayout> with just a hard return as a subset of the <para> tag (using teh xsl to look for the <br/> tag and insert the <literallayout> wrapping a hard return), but I get the extra "paragraph" spacing I don't want....
So.. does anyone have any suggestions for what I could try or use to insert a linebreak in the Docbook text. If I'm up against a "you can't do this" situation, I'm willing to adjust my XML and make a new tag for the instances I want the BR and map that specifically to the <literallayout> tag in the xsl... but I figure it's worth asking before I do this...