Creating XML Files
To create a new XML file, select [Other] > [XML] > [XML] from [New] under the [File] menu. This launches the [New XML File] wizard. Specify the file name, creation method, and other information required to create the XML file as indicated in the wizard pages.
On the [Create XML File From] page of the [New XML File] wizard, select from the following XML file creation methods:
Create XML file from a DTD file
Create the XML file on the basis of the definitions in a DTD file selected from the workspace or XML catalog.
Create XML file from an XML schema file
Create the XML file on the basis of the definitions in an XML schema file selected from the workspace or XML catalog.
Create XML file from an XML template
Create the XML file on the basis of a registered template.
Editing XML Files
Use the XML editor to edit XML files. When the XML file is opened and operated in the Project Explorer or the Navigator view, the file opens in the XML editor. The XML editor provides the following editing support:
Content Assist
The [Ctrl+Space] keys can be pressed from the editor to display a list of possible values that can be inserted at that location. If DTD and XML schemas are specified in the XML that is being edited, the element names, attribute names, and attribute values that can be entered in accordance with those specification are displayed as suggestions. If DTD and XML schemas are not specified, element names, attribute names, and attribute values extracted from the XML being edited are displayed as suggestions.
Editing using the Design view
The [Design] view can be used to edit XML data and attribute values using a grid-format editor. Alternatively, the following editing operations can be performed using the context menu of the [Design] view:
At the processing instruction context menu, [Edit Processing Instruction] can be selected to edit the processing instruction attributes.
At the DOCTYPE context menu, [Edit DOCTYPE] can be selected to edit the DOCTYPE attributes.
At the element context menu, [Add Child] can be selected to add elements using a tree format that includes child elements and further child elements.
Cleanup
When [Cleanup Document] is selected from the [Source] menu, the following operations can be applied as a batch to the file being edited. The format is in accordance with the format set using [XML]>[XML Files]>[Editor] under [Preferences] in the [Window] menu.
Compress empty element tags
Insert required attributes
Insert missing tags
Quote attribute values
Format source
Convert line delimiters
Quick fix
On the XML editor, any places that have compile errors in the source or warnings are displayed with a wavy line. When the [Ctrl+1] keys are pressed at a wavy line, suggestions on how to correct the error or warning are displayed. For example, if there is no closing tag, suggestions to either insert an end tag before the next child element or to insert an end tag at the end of the element are displayed. When one of the suggestions is selected, that correction is applied.