blob: 620e4599aa32a0f68ba8e40dd45a9f2121da37f4 [file] [log] [blame]
kpriceef160682006-08-29 18:08:31 +00001<?xml version="1.0" encoding="utf-8"?>
kpriceb59c9f62008-04-02 21:24:37 +00002<!--Arbortext, Inc., 1988-2006, v.4002-->
3<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "task.dtd">
kpriceef160682006-08-29 18:08:31 +00005<task id="txedtdes" xml:lang="en-us">
6<title>Editing in the Design view</title>
7<titlealts>
8<searchtitle>Editing in the Design view</searchtitle>
9</titlealts>
10<shortdesc>The XML editor has a Design view, which represents the XML file
11simultaneously as a table and a tree. This helps make navigation and editing
12easier. Content and attribute values can be edited directly in the table cells,
13while pop-up menus on the tree elements give alternatives that are valid for
14that particular element.</shortdesc>
15<prolog><metadata>
kprice9623e9d2007-05-03 03:43:05 +000016<keywords><indexterm>XML editor<indexterm>Design view</indexterm></indexterm>
17</keywords>
kpriceef160682006-08-29 18:08:31 +000018</metadata></prolog>
19<taskbody>
kpriceb59c9f62008-04-02 21:24:37 +000020<context><p>For example, the <uicontrol>Add child</uicontrol> menu item will
kpriceef160682006-08-29 18:08:31 +000021list only those elements from a DTD or XML schema which would be valid children
22at that point.</p><p>When you have an XML file associated with an XML schema
23or DTD file, certain tags and rules for that file have already been established,
24which is why the Design view can provide prompts (via a pop-up menu) for those
25tags. When you create an XML file that is not associated with an XML schema
26or DTD file, it has no tags or rules associated with it, so the Design view
27cannot provide prompts for specific tags, but it can provide prompts to create
28new elements and attributes.</p><p>For any XML file associated with an XML
29schema or DTD file, you can use the Design view to add any items defined in
30the XML schema or DTD (such as elements and attributes) to the XML file. You
kpriceb59c9f62008-04-02 21:24:37 +000031can also use it to add processing instructions and comments to all XML files.</p><p>To
32open and edit a XML file in the XML editor, right-click the file in the Navigator
33view and click <uicontrol>Open With > XML Editor</uicontrol>. If necessary,
34click the <uicontrol>Design</uicontrol> tab to open the Design view.</p><p>To
35expand all the items in your XML file, click <menucascade><uicontrol>XML</uicontrol>
36<uicontrol>Expand All</uicontrol></menucascade> <image href="../images/expand_all.gif">
37<alt>This graphic is the Expand All toolbar button</alt></image> on the toolbar.
38To collapse them, click the <menucascade><uicontrol>XML</uicontrol><uicontrol>Collapse
kpricedb43fb32008-07-23 20:16:44 +000039All</uicontrol></menucascade> <image href="../images/collapse_all.gif"><alt>This
40graphic is the Collapse All toolbar button</alt></image> on the toolbar.</p><p>If
41you right-click the item that you want to work with, some or all of the following
42options (as applicable) will be available from the pop-up menu that appears:</p><table>
kpriceb59c9f62008-04-02 21:24:37 +000043<tgroup cols="2"><colspec colname="col1" colwidth="48*"/><colspec colname="col2"
44colwidth="150*"/>
45<thead>
46<row valign="bottom">
47<entry colname="col1">Select this</entry>
48<entry colname="col2">If you want to do this</entry>
49</row>
50</thead>
51<tbody>
52<row>
53<entry colname="col1">Add DTD Information</entry>
54<entry colname="col2">Associate the XML file with a DTD.</entry>
55</row>
56<row>
57<entry colname="col1">Edit DOCTYPE</entry>
58<entry colname="col2">Edit the DOCTYPE declaration. Refer to the related task
kpricedb43fb32008-07-23 20:16:44 +000059for more details. For more information, see <xref format="dita" href="tedtdoc.dita"
60scope="local">Editing DOCTYPE declarations</xref>.</entry>
kpriceb59c9f62008-04-02 21:24:37 +000061</row>
62<row>
63<entry colname="col1">Edit Namespaces</entry>
64<entry colname="col2">Edit the existing namespace information or create a
65new association with a namespace. Refer to the related task for more details.
kpricedb43fb32008-07-23 20:16:44 +000066For more information, see <xref format="dita" href="tedtsch.dita" scope="local">Editing
kpriceb59c9f62008-04-02 21:24:37 +000067namespace information</xref>.</entry>
68</row>
69<row>
70<entry colname="col1">Edit Processing Instruction</entry>
71<entry colname="col2">Edit the processing instruction. Refer to the related
kpricedb43fb32008-07-23 20:16:44 +000072task for more details. For more information, see <xref format="dita" href="tedtproc.dita"
73scope="local">Editing XML processing instructions</xref>.</entry>
kpriceb59c9f62008-04-02 21:24:37 +000074</row>
75<row>
76<entry colname="col1">Remove</entry>
77<entry colname="col2">Remove the item that you have selected from the XML
78file. If the selected item or related items are defined so that the item must
79exist in the file, this option will not be available. For example, in your
80DTD, if you have declared that "One or more" of the item must always exist
81in your XML file, and the item you have selected is the only one that exists
82in your XML file.</entry>
83</row>
84<row>
85<entry colname="col1">Add Attribute</entry>
86<entry colname="col2">Add an attribute to the element that you selected. Any
87attributes you are allowed to add to the element will be listed. After you
88have added the attribute to the XML file, you can click in the right-hand
89column to change the value of the attribute. If the attribute has set values,
90they will appear in a list.</entry>
91</row>
92<row>
93<entry colname="col1">Add Child</entry>
94<entry colname="col2">Add another element, a comment, or a processing instruction
95as a child of the parent element.</entry>
96</row>
97<row>
98<entry colname="col1">Add Before</entry>
99<entry colname="col2">Add a child element, comment, or processing instruction
100that can go before the item you have selected. For example, if you have a
101parent element called <userinput>CD Collections</userinput> that can contain
102an unlimited amount of children called <userinput>CD</userinput>, you could
103click a <userinput>CD</userinput> element and click <menucascade><uicontrol>Add
104Before</uicontrol><uicontrol> CD</uicontrol></menucascade> , as a <userinput>CD</userinput> element
105can go before another <userinput>CD</userinput> element.</entry>
106</row>
107<row>
108<entry colname="col1">Add After</entry>
109<entry colname="col2">Add a child element, comment, or processing instruction
110that can go after the item you have selected. For example, if you have a parent
111element called <userinput>CD Collections</userinput> that can contain an unlimited
112amount of children called <userinput>CD</userinput>, you could click a <userinput>CD</userinput> element
113and click <menucascade><uicontrol>Add After</uicontrol><uicontrol> CD</uicontrol>
114</menucascade>, as a <userinput>CD</userinput> element can go after another <userinput>CD</userinput> element.</entry>
115</row>
116<row>
117<entry colname="col1">Replace With</entry>
118<entry colname="col2">Replace one item with another. This option is not available
119if you turn grammar constraints off or if there are no valid alternatives
120for you to replace the item with.</entry>
121</row>
122</tbody>
123</tgroup>
124</table></context>
kpriceef160682006-08-29 18:08:31 +0000125<result><p>Any changes you make in the Design view are also reflected in the
kpriceb59c9f62008-04-02 21:24:37 +0000126Source view and the Outline view.</p><note>These instructions were written
127for the Resource perspective, but they will also work in many other perspectives.</note></result>
kpriceef160682006-08-29 18:08:31 +0000128</taskbody>
129</task>