Page 1 of 1

Better pretty-print for fo files

Posted: Fri Nov 11, 2011 12:36 pm
by anderszvensson

Something that has been problematic for a long time is that viewing the fo files from DITA transformations (at least) is very hard due to the fact that pretty-printing (indenting/formatting) the fo is not working ideally. It does format it, but not nearly as well as with, say, dita files or xsl files. To have each element block lined up neatly would greatly simplify debugging.



Re: Better pretty-print for fo files

Posted: Fri Nov 11, 2011 6:43 pm
by adrian

Oxygen does not format the XML content(including FO) if in doing so, the XML content would be changed in a significant way.
This is why it doesn't break the line inside an fo:block between two adjacent child elements. fo:block is a mixed content element and inserting spaces or line breaks affects the content significantly and would also reflect in the end result when processing the FO.

One solution around this would be to write a simple XSLT stylesheet that copies and formats the FO the way you want.

Alternatively, if the FO is of a reasonable size(<10MB), you could switch to Author mode(Document -> Edit Mode -> Author) and see if that way of displaying the document helps.

Note that the Author mode has several tag display modes: Author -> Tags display mode. Try Full Tags or Block Tags and see if that helps. Note that these modes hide the attributes, if you want to see the attributes as well(which is a bit messy) you can use the Full Tags with Attributes mode.