Better pretty-print for fo files

Are you missing a feature? Request it's implementation here.
Posts: 71
Joined: Wed Jul 14, 2010 11:38 am

Better pretty-print for fo files

Post by anderszvensson » Fri Nov 11, 2011 12:36 pm


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.



Posts: 2659
Joined: Tue May 17, 2005 4:01 pm

Re: Better pretty-print for fo files

Post by adrian » Fri Nov 11, 2011 6:43 pm


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.

Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Post Reply