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