XSL-FO - is it possible to automatically format sourcecode?
Can this be done? I have a elemen开发者_运维问答t <programlisting>
with a source code or XML part and I want to make it look nice. The only solution I found is to add white-space="pre"
in the transformation and format the XML manualy. But the painful thing is autoformat in the Eclipse IDE which ruins the manual attempt every time I use it.
I am assuming that you are producing a PDF. Is it for e-reading or print? Or to put it differently do you need need users to select/highlight the code and copy? If not you may consider using images to preserve the layout - hardly an ideal solution, but it will look as you want it to. What language is the source code? Are you using Docbook (it looks like you are) Are you wrapping your code inside CDATA?
精彩评论