About Using Code Completion in XML Instance Documents Constrained by XML Schema

See Also

You can use code completion in XML files if the XML document is constrained by an XML schema. In the schema source file, this constraint is represented by a xsi:schemaLocation or a xsi:noNamespaceSchemaLocation attribute in the root element of the schema. Typically, xsi:schemaLocation is used for schemas with a target namespace and xsi:noNamespaceSchemaLocation is used for schemas with no target namespace.

As a general rule, if the root elements provide the necessary information to locate the schemas, the IDE will be able to offer code completion based on those schemas. The IDE will attempt to locate the schemas in the following order:

  1. Check the local file system to find the schema.
  2. If not found in the local file system, perform a lookup in the runtime catalog.

If the IDE does not find the schemas in the local file system or the runtime catalog, code completion will not be available.

The code completion functionality provides two types of code completion:

You can use code completion in XML instance documents in several ways:

To complete an XML tag in an XML document:

  1. Open the XML document in the Source Editor and position the cursor where you want to start adding content and type an opening left angle bracket (<).
    If you want to use code completion in an existing element, simply position your cursor within the element and press Spacebar or type any character to invoke code completion.
  2. Pause after step 1, or press Ctrl-Spacebar.
    The code completion box opens. This box provides a scrolling list of schema elements. The list of elements is based on the XML schema file that constrains the current XML file.
  3. Select a value using the information in Selecting Values in the Code Completion Box.
    If you select a component with attributes, the next Spacebar keystroke will invoke the code completion box with the attributes.

Selecting Values in the Code Completion Box

You can use the most convenient combination of the following options to select values in the code completion box:

See Also
About XML Schema Tools
Using Code Completion
Registering a Local DTD or XML Schema Resource

Legal Notices