21.7 XML

The XML preferences lets you specify how Designer should handle editing and creation of an XML catalog and XML files. This an Eclipse option; for more details, see the Eclipse documentation.

21.7.1 XML Catalog

The XML Catalog preferences allow you to manage the WST XML catalog implementation. You can add, edit, or delete user-specified catalogs. You cannot use this preference to manage the plug-in specified entries.The XML editor uses the WST XML catalog implementation to resolve XML schema and DTD references for associating URLs, system, and public identifiers with URLs.

Figure 21-6 Preferences: XML > XML Catalog

To add a user-specified entry:

  1. Click Add.

  2. Fill in the fields as follows:

    Field

    Description

    Location

    Specify a location on disk or a URL of the schema or DTD. Use the Search icon to search Designer’s workspace or the file system.

    Key Type

    Specify the key type. Values are public identifiers for DTDs or URIs for XML schemas.

    Key

    Specify a unique key.

    Specify alternative web address

    Optionally, specify an alternative Web address for locating the schema or DTD.

  3. Click OK to save.

21.7.2 XML Files

You can set the following general XML File preferences:

Table 21-61 Preferences: XML > XML Files

Setting

Descriptions

Creating files: Add this suffix

Add a suffix to the file. The default is XML.

Creating files: Encoding:

Select the encoding used by the user.

Creating files: IANA

The IANA name is used in the encoding statement of the XML file.

Validating files: Indicate when no grammar is specified

Specifies whether to display a warning when no grammar (such as XML Schema or DTD) is associated with the XML document.

Validating files: Process XML Inclusions

If the XML file contains inclusions (snippets from an HTML file used to create the dynamic HTML page), process these inclusions.

Editor

Table 21-62 Preferences: XML > XML Files > Editor

Category

Preference

Description

Formatting

Line width

Specifies the number of characters in a line. The default is 72.

 

Split multiple attributes each on a new line

Specifies how attributes are formatted (whether to show each attribute on a separate line).

 

Align final bracket in multi-line element tags

Allows you to align the final bracket “>” in multi-line element tags.

 

Preserve whitespace in tags with PCDATA content

Specifies whether to preserve any white spaces that are in tags containing PCDATA content.

 

Clear all blank lines

Specifies whether blank lines are removed when formatting.

 

Indent using tabs/ or spaces

Indentation size

Specifies whether to use tabs or spaces as indentation and indentation size.

Content Assist

Automatically make suggestions

Specifies whether to do automatic code completion.

 

Prompt when these characters are inserted

The list of characters that initiate code completion.

 

Suggestion strategy

Specifies whether to use Lax or Strict grammar when making suggestions

Grammar constraints

Use inferred grammar in absence of DTD/Schema

Specifies whether to display code completion suggestions based on existing content of the XML document.

Syntax Coloring

The XML syntax coloring lets you specify the syntax highlighting (foreground and background color) and the text formatting for individual XML constructs.

Table 21-63 Preferences: XML > XML Files > Syntax Coloring Settings

Setting

Description

Syntax Element

Choose the content type for which you want to define a style.

Foreground/Background/Bold/Italic/Strikethrough/Underline

Specifies the syntax highlighting and formatting for individual CSS elements.

Sample Text

Displays sample CSS with the selected syntax coloring options.

XML Templates

Use the XML Templates preference page to define XML templates. The templates are used in the code completion in the XML Source editor. For example, selecting the XSL Processing Instruction template in the code completion inserts <?xml-stylesheet type=”text/xsl” href=”?"> in the source editor and places the cursor in the href value.

Typing

Table 21-64 Preferences: XML > XML Files > Typing

Settings

Descriptions

Automatically close: Comments

The HTML editor automatically closes any comments add to the HTML file.

Automatically close: End tags

The HTML editor automatically closes any end tags in the HTML file.

Automatically remove: End tags

The HTML editor automatically removes any end tags when creating empty self-closing tags.