| <?xml version="1.0" encoding="utf-8"?> | |
| <!--Arbortext, Inc., 1988-2005, v.4002--> | |
| <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> | |
| <?Pub Inc?> | |
| <task id="txedtdes" xml:lang="en-us"> | |
| <title>Editing in the Design view</title> | |
| <titlealts> | |
| <searchtitle>Editing in the Design view</searchtitle> | |
| </titlealts> | |
| <shortdesc>The XML editor has a Design view, which represents the XML file | |
| simultaneously as a table and a tree. This helps make navigation and editing | |
| easier. Content and attribute values can be edited directly in the table cells, | |
| while pop-up menus on the tree elements give alternatives that are valid for | |
| that particular element.</shortdesc> | |
| <prolog><metadata> | |
| <keywords><indexterm>XML editor<indexterm>Design view</indexterm></indexterm> | |
| </keywords> | |
| </metadata></prolog> | |
| <taskbody> | |
| <context><p> For example, the <uicontrol>Add child</uicontrol> menu item will | |
| list only those elements from a DTD or XML schema which would be valid children | |
| at that point.</p><p>When you have an XML file associated with an XML schema | |
| or DTD file, certain tags and rules for that file have already been established, | |
| which is why the Design view can provide prompts (via a pop-up menu) for those | |
| tags. When you create an XML file that is not associated with an XML schema | |
| or DTD file, it has no tags or rules associated with it, so the Design view | |
| cannot provide prompts for specific tags, but it can provide prompts to create | |
| new elements and attributes.</p><p>For any XML file associated with an XML | |
| schema or DTD file, you can use the Design view to add any items defined in | |
| the XML schema or DTD (such as elements and attributes) to the XML file. You | |
| can also use it to add processing instructions and comments to all XML files.</p><p>For | |
| more information on the icons used in the Design view, refer to the related | |
| reference.</p><p>The following instructions were written for the Resource | |
| perspective, but they will also work in many other perspectives.</p><p>To | |
| edit an XML file in the Design view, follow these steps:</p></context> | |
| <steps> | |
| <step><cmd>Open the XML file that you want to work with in the XML editor | |
| (right-click the file in the Navigator view and click <uicontrol>Open With | |
| > XML Editor</uicontrol>). If necessary, click the <uicontrol>Design</uicontrol> tab.</cmd> | |
| </step> | |
| <step><cmd>To expand all the items in your XML file, click the <uicontrol>Expand | |
| All</uicontrol> toolbar button <image href="../images/expand_all.gif"><alt>This | |
| graphic is the Expand All toolbar button</alt></image>.</cmd></step> | |
| <step><cmd>To collapse them, click the <uicontrol>Collapse All</uicontrol> toolbar | |
| button <image href="../images/collapse_all.gif"><alt>This graphic is the | |
| Collapse All toolbar button</alt></image>.</cmd></step> | |
| <step><cmd>Right-click the item that you want to work with.</cmd><info>Some | |
| or all of the following options (as applicable) will be available from the | |
| pop-up menu that appears:<ul> | |
| <li> <uicontrol>Add DTD Information</uicontrol> - Click this if you want to | |
| associate the XML file with a DTD.</li> | |
| <li> <uicontrol>Edit DOCTYPE</uicontrol> - Click this if you want to edit | |
| the DOCTYPE declaration. Refer to the related task for more details.</li> | |
| <li> <uicontrol>Edit Namespaces</uicontrol> - Click this if you want to edit | |
| the existing namespace information or create a new association with a namespace. | |
| Refer to the related task for more details.</li> | |
| <li> <uicontrol>Edit Processing Instruction</uicontrol> - Click this if you | |
| want to edit the processing instruction. Refer to the related task for more | |
| details.</li> | |
| <li> <uicontrol>Remove</uicontrol> - Click this if you want to remove the | |
| item that you have selected from the XML file. This option will not be available | |
| if the item you want to remove must exist (for example, in your DTD, you have | |
| declared that "One or more" of the item must always exist in your XML file, | |
| and the item you have selected is the only one that exists in your XML file).</li> | |
| <li> <uicontrol>Add Attribute</uicontrol> - Click this if you want to add | |
| an attribute to the element that you selected. Any attributes you are allowed | |
| to add to the element will be listed. After you have added the attribute to | |
| the XML file, you can click in the right-hand column to change the value of | |
| the attribute. If the attribute has set values, they will appear in a list.</li> | |
| <li> <uicontrol>Add Child</uicontrol> - Click this to add another element, | |
| a comment, or a processing instruction as a child of the parent element.</li> | |
| <li> <uicontrol>Add Before</uicontrol> - Click this to add a child element, | |
| comment, or processing instruction that can go before the item you have selected. | |
| For example, if you have a parent element called "CD Collections" that can | |
| contain an unlimited amount of children called "CD", you could click a CD | |
| element and click <menucascade><uicontrol>Add Before</uicontrol><uicontrol> CD</uicontrol> | |
| </menucascade> , as a CD element can go before another CD element.</li> | |
| <li> <uicontrol>Add After</uicontrol> - Click this to add a child element, | |
| comment, or processing instruction that can go after the item you have selected. | |
| For example, if you have a parent element called "CD Collections" that can | |
| contain an unlimited amount of children called "CD", you could click a CD | |
| element and click <menucascade><uicontrol>Add After</uicontrol><uicontrol> CD</uicontrol> | |
| </menucascade>, as a CD element can go after another CD element.</li> | |
| <li> <uicontrol>Replace With</uicontrol> - Click this if you want to replace | |
| one item with another. This option is not available if you turn grammar constraints | |
| off or if there are no valid alternatives for you to replace the item with.</li> | |
| </ul></info></step> | |
| <step><cmd>Click the appropriate option.</cmd></step> | |
| </steps> | |
| <result><p>Any changes you make in the Design view are also reflected in the | |
| Source view and the Outline view.</p></result> | |
| </taskbody> | |
| </task> | |
| <?Pub *0000005971?> |