# Defining XML editor preferences

You can set various preferences for the Source view of the XML editor such as the formatter indentation style, line wrapping rules, and content assist rules. To apply the formatting styles, right-click in the Source view for your XML document, and click Format > Document.

To define XML preferences, complete the following steps:

1. Click Window > Preferences and select XML > XML Files > Editor.
2. Enter a maximum width for formatted lines in the Line width field The default value is 72.
3. Select Split multiple attributes each on a new line to start every attribute on a new line.
4. Select Preserve whitespace in tags with PCDATA content to prevent the editor from deleting whitespace in elements that contain parsed character data.
5. If you want blank lines to be removed when the document is formatted, select the Clear all blank lines check box. By default, blank lines are preserved in a formatted document.
6. Select Indent using tabs if you want to use tab characters (\t) as the standard formatting indentation, or, if you prefer to use spaces, select Indent using spaces.
7. You can also specify the Indentation size which is the number of tabs or space characters used for formatting indentation.
8. You can specify certain characters (the default command is <=) that will cause the content assist list to pop up automatically. Ensure the Automatically make suggestions check box is selected and specify the characters in the Prompt when these characters are inserted field.
9. If you select Strict from the Suggestion strategy list, suggestions that are grammatically valid will be shown first (with bold icons) in the content assist list. Other suggestions that are applicable to the element scope, but not grammatically valid, will be shown below them with a de-emphasized icon. The default value for this field is Strict.
10. The Use inferred grammar in absence of DTD/Schema check box is selected by default. If this box is selected, when you have an XML file that is not associated with a DTD or XML schema, you will still be able to get content assist - the tool will infer what should come next in your file based on the existing content.
11. Click Apply and then OK to save your changes.