Adding Nodes

To add new elements to your document, right-click on the item you want to add something to, and go to the Add menu as shown in Figure 3.6. Xerlin displays just the elements that are valid to add at the point specified by the element you right-clicked on. There are also menus for adding elements Before or After the given element. These menus are all built from the DTD at runtime, so you can only create documents which are valid according to the DTD.

Figure 3.6. Add Menu

When you add an element into another, it places it at the end of the parent element. Use the Add->Before and Add->After if you need to be more precise about where a new element should be placed.

You can also add comments and processing instructions from the Add->Special menu. These show up as "#comment" and "?pi?" in the Element Tree.