# Using XML content assist

You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert macros into your XML code. The placement of the cursor in your source file provides the context for the content assist to offer suggestions for completion.

You can launch content assist in any of the following ways:

- From the Edit menu, click Content Assist, or
- Press Ctrl+Space, or

In addition, you can set up an option that causes content assist to pop up automatically when certain characters are typed. To set up this option, click Window > Preferences to open the Preferences window, then click Web and XML > XML Files > XML Source . In the Content assist group box, select the Automatically make suggestions check box, and supply any additional characters that should trigger content assist.

If your cursor is in a position where content assist is available, a pop-up list of available choices is displayed when you launch content assist. The list is based on the context and whether a DTD or XML schema is associated with the XML file being edited. For example, if you have an Address element that can contain any of the following children elements: Name, Street, City, Zip Code, Country, and Province, if you place your cursor after any of them and launch content assist, all of the child elements will be listed in the content assist list.

The content assist list displays all valid tags for the current cursor position, including templates. If your grammar constraints are turned off, all available tags, not just valid ones are displayed.

As you type the first one or two letters of the tag that you want, the list automatically refreshes with alphabetized choices that match your input.

Note: The list only refreshes as described if you first type `<` before prompting for content assist.

Scroll down and select the tag that you want to use by double-clicking on it.

(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.