When editing content with <oXygen/> the document will lay out nicely while you edit it just like after a pretty print operation. For instance when you press Enter after an element the content cursor will perform an indent on the next line. If you press Enter after a closing tag it will be automatically aligned with the corresponding start tag.
Although writing documents with no indentation is a perfectly acceptable practice, it makes editing difficult and is error prone. It also makes the identification of exact error positions difficult. Formatting and Indenting, also called "Pretty Print", enables the XML documents to be neatly arranged in a manner that is consistent and promotes easier reading.
XML documents can be formatted and indented with the following options. You can specify the indent size, the maximum line length and if spaces or tab should be used for indenting.
To control the elements that should not be processed you can use the xml:space attribute and specify its value to "preserve" or "default" depending on whether you want to keep the text content unchanged. Another way is to edit the two lists of elements that will be treated as if they have an xml:space attribute with the value "preserve" and "default" respectively. Advanced options allows you to sort the attributes or keep their document order and to output empty elements as empty tags or as start and end tag.
This is a light alternative to the pretty print operation. After you select a region of text you can choose this option to indent the selected lines. The indenting will not perform any hard wrapping, only the white spaces at the beginning of each line will be affected by inserting or removing other whitespaces so that the lines will be indented. The action is available in the contextual menu.
This feature saves time when writing an XML document with a lot of text content. You can set a limit for the length of the lines in your document using the line width formatting option. When this limit is exceeded the editor will insert a new line before the word that breaks the limit, and indent the next line. This will minimize the need of reformatting the document. You can activate this feature from the options.
The editor tries to detect the indent settings (indent size, indent with tabs or spaces) of the opened XML document. That allows to correctly format (pretty-print) files that were created with different settings, without changing your options. More than that you can activate the advanced option for detecting the maximum line width to be used for formatting and hard wrap. These features were designed to minimize the differences created by the pretty print operation when working with a versioning system, like CVS for example.
The two options are "Detect indent on open" and "Detect line width on open" from the above dialog.
The editor indents the pasted text sections. This speeds up the editing and keeps the document formatted. It is activated by default.