I have data stored in structured XML that I want to make it more readable using XSLT (or another alternative). The target document should have lots of instances of text aligned both to the left and to the right in the same line, and I need to have a behaviour like div floats:
<div style="float: left;">
<p align=left>
Left text. Left text. Left text. Left text. Left text. Left text.
</p>
</div>
<div style="float: right;">
<p align=right>
Right text. Right text. Right text. Right text. Right text. Right text.
</p>
</div>
<div style="clear: both;" />
This way, when the text lenght of both are bigger than the container width, the "Left text" DIV is written, then the "Right text" DIV is writter BELOW it.
I can't use XSLT to make a HTML file, because it will be use in print and I also need a language that has some "keep together" feature at page breaks (if a page break occurs in the middle of the element, it should break before the element). Having tables that supports auto sizing its columns (like the HTML table) would be a huge plus but not required.
I was studying XSL-FO, but I couldn't find a free renderer that supports those features. I thought about using XSL to make a WordML file, but I haven't found any tutorials on it. Having a Word (or Open Office) document would be great, cause I could make minor adjustments. Also, I'm considering using LaTex.
What can you suggest me?
EDIT: I was checking some CSS features that I didn't know about (haven't messed with it in years) and it does have some print related features (page-break-inside:avoid, @page, etc) besides having an excelent support for floats and auto layout of tables. Even though the print features are not widelly supported, Opera and IE do support it and I ran some tests in IE9 an it rendered very well. So I will try XSLT with HTML/CSS since it has everything I need and will have a smoother learning curve (I already know some CSS and have use HTML for years).
I think you should decide for a more general approach to your problem by going with some well known XML standard schema like DITA or DOCBOOK.
These schemas have the advantage of letting you write your own XML and render it as you need according to the output format they support. Moreover, they are free and you can obtain PDF, RTF, WebHelp, HTML and so on easily once you have the corret source documents.
So, you need to:
If you decide for DITA, you have two free choices there:
Personally, I would go with DITA and DITA-OT because it has the flexibility of plugins based on XSLT and custom builds based on ANT. But both have their reasons. I started with DITA-OT and ended using both DITA-OT and DITAC.
I did not put any reference here, because you can easily find what you need using Google.
ABOUT FLOAT
DITA-OT provides a specific XSL-FO transtype which is called PDF2 and whose XSL-FO processor is RenderX. RenderX currently supports fo:float so I imagine you will be able to find your way. May be you will need to override some PDF2 template, which is definitely simpler than implementing your own PDF transform.
Note that RenderX is feasable as long as a small foot watermark on each page is acceptable for you. Otherwise you should spend some money.