XML files can be managed through the toolbar icons or File menu options that the XML Editor provides, and a Document Type Definition (DTD) is required to create or add to XML files:
Table A-1 describes the XML Editor toolbar and menu options:
Table A-1 XML Editor Options
Option |
Function |
---|---|
![]() |
Returns focus to the element that was previously selected. |
![]() |
Select the parent of the currently selected element. Continue clicking to move up the hierarchy. |
![]() |
Select the top of the hierarchy. |
![]() |
Saves the XML file using the current name. |
![]() |
Undo any updates or modifications made on the hierarchy. |
![]() |
Cuts the selected text from the current XML file. |
![]() |
Copies the selected text into the current XML file. |
![]() |
Pastes the cut of copied text into the current XML file. |
![]() |
Adds a new element or text to the XML file. |
File > Revert |
Abandons all changes made in the current session and opens the saved version of the XML file. |
File > Save File > Save As |
Saves the XML file currently loaded in the editor. |
File > Exit |
Closes the XML Editor. |
The DTD is specified at the top of an XML file to specify the valid elements for the file. The DTD is identified using the DOCTYPE element, as shown in the following example:
<!DOCTYPE hierarchy PUBLIC "‑//Managed Object Solutions, Inc.//DTD hierarchy 2.0//EN" "http://www.ManagedObjects.com/dtds/hierarchy_2.0.dtd">
All DTDs provided by Operations Center are located in the /OperationsCenter_install_path/database/examples directory.
If an XML file that does not contain a DTD is opened in the XML Editor, the following error message displays:
Figure A-2 Error Message: XML files with no DTD
It is possible to view and edit the XML file, but not to add items to it.
To select a DTD when creating an XML file:
Click New on the toolbar.
The XML Editor displays the following dialog box for selecting a DTD:
Do one of the following:
Select a standard Operations Center DTD.
Click Browse, select a DTD from a different location, then click OK.
Operations Center provides a DTD for algorithms, hierarchy, and View Builder XML files.
The Enter a Public ID dialog box prompts for a public ID for the DTD.
Enter an ID.
The ID entered here displays in the Select a DTD File dialog box when the New icon or File > New is selected:
To skip creating a public ID, click None to open the Choose Root Element dialog box.
Select a root element.
The selected root element displays in the Element column:
Click OK to display the DTD.