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 .
To define XML preferences, complete the following steps:
- Click and select .
- Enter a maximum width for formatted lines in the Line
width field The default value is 72.
- Select Split multiple attributes each on a new line to
start every attribute on a new line.
- Select Preserve whitespace in tags with PCDATA content to
prevent the editor from deleting whitespace in elements that contain parsed
character data.
- 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.
- 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.
- You can also specify the Indentation size which
is the number of tabs or space characters used for formatting indentation.
- 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.
- 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.
- 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.
- Click Apply and then OK to
save your changes.