blob: 91c1d1e0151d89fcf71d1577521fa76abb8221a4 [file] [log] [blame]
kpriceef160682006-08-29 18:08:31 +00001<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html lang="en-us" xml:lang="en-us">
syeshinbefd53e2005-07-27 18:16:40 +00003<head>
kpriceef160682006-08-29 18:08:31 +00004<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
kpriceb59c9f62008-04-02 21:24:37 +00005<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
6<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
kpriceef160682006-08-29 18:08:31 +00007<meta content="public" name="security" />
8<meta content="index,follow" name="Robots" />
9<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
10<meta content="task" name="DC.Type" />
11<meta name="DC.Title" content="Editing in the Design view" />
12<meta name="abstract" content="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." />
13<meta name="description" content="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." />
kpriceb59c9f62008-04-02 21:24:37 +000014<meta content="XML editor, Design view" name="DC.subject" />
15<meta content="XML editor, Design view" name="keywords" />
kpriceef160682006-08-29 18:08:31 +000016<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
17<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
18<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
19<meta scheme="URI" name="DC.Relation" content="../topics/tedtdoc.html" />
20<meta scheme="URI" name="DC.Relation" content="../topics/tedtsch.html" />
21<meta scheme="URI" name="DC.Relation" content="../topics/tedtproc.html" />
22<meta scheme="URI" name="DC.Relation" content="../topics/rxmlbicons.html" />
23<meta content="XHTML" name="DC.Format" />
24<meta content="txedtdes" name="DC.Identifier" />
25<meta content="en-us" name="DC.Language" />
26<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
syeshinbefd53e2005-07-27 18:16:40 +000027<title>Editing in the Design view</title>
syeshin66078272005-09-20 16:53:38 +000028</head>
syeshinbefd53e2005-07-27 18:16:40 +000029<body id="txedtdes"><a name="txedtdes"><!-- --></a>
30
kpriceef160682006-08-29 18:08:31 +000031
syeshinbefd53e2005-07-27 18:16:40 +000032<h1 class="topictitle1">Editing in the Design view</h1>
kpriceef160682006-08-29 18:08:31 +000033
34
35
36
syeshinbefd53e2005-07-27 18:16:40 +000037<div><p>The XML editor has a Design view, which represents the XML file
38simultaneously as a table and a tree. This helps make navigation and editing
39easier. Content and attribute values can be edited directly in the table cells,
40while pop-up menus on the tree elements give alternatives that are valid for
kpriceef160682006-08-29 18:08:31 +000041that particular element.</p>
42
kpriceb59c9f62008-04-02 21:24:37 +000043<div class="section"><p>For example, the <span class="uicontrol">Add child</span> menu item will
syeshinbefd53e2005-07-27 18:16:40 +000044list only those elements from a DTD or XML schema which would be valid children
45at that point.</p>
46<p>When you have an XML file associated with an XML schema
47or DTD file, certain tags and rules for that file have already been established,
48which is why the Design view can provide prompts (via a pop-up menu) for those
49tags. When you create an XML file that is not associated with an XML schema
50or DTD file, it has no tags or rules associated with it, so the Design view
51cannot provide prompts for specific tags, but it can provide prompts to create
52new elements and attributes.</p>
53<p>For any XML file associated with an XML
54schema or DTD file, you can use the Design view to add any items defined in
kpriceef160682006-08-29 18:08:31 +000055the XML schema or DTD (such as elements and attributes) to the XML file. You
56can also use it to add processing instructions and comments to all XML files.</p>
syeshinbefd53e2005-07-27 18:16:40 +000057<p>To
kpriceb59c9f62008-04-02 21:24:37 +000058open and edit a XML file in the XML editor, right-click the file in the Navigator
59view and click <span class="uicontrol">Open With &gt; XML Editor</span>. If necessary,
60click the <span class="uicontrol">Design</span> tab to open the Design view.</p>
61<p>To
62expand all the items in your XML file, click <span class="menucascade"><span class="uicontrol">XML</span>
63 &gt; <span class="uicontrol">Expand All</span></span> <img src="../images/expand_all.gif" alt="This graphic is the Expand All toolbar button" /> on the toolbar.
64To collapse them, click the <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">Collapse
65All</span></span> <img src="../images/collapse_all.gif" alt="This graphic is the Collapse All toolbar button" /> on the
66toolbar.</p>
67<p>If you right-click the item that you want to work with, some
syeshinbefd53e2005-07-27 18:16:40 +000068or all of the following options (as applicable) will be available from the
kpriceb59c9f62008-04-02 21:24:37 +000069pop-up menu that appears:</p>
70<p />
kpriceef160682006-08-29 18:08:31 +000071
kpriceb59c9f62008-04-02 21:24:37 +000072<div class="tablenoborder"><table summary="" cellspacing="0" cellpadding="4" frame="border" border="1" rules="all">
73<thead align="left">
74<tr valign="bottom">
75<th valign="bottom" width="24.242424242424242%" id="N100D8">Select this</th>
kpriceef160682006-08-29 18:08:31 +000076
kpriceb59c9f62008-04-02 21:24:37 +000077<th valign="bottom" width="75.75757575757575%" id="N100DF">If you want to do this</th>
kpriceef160682006-08-29 18:08:31 +000078
kpriceb59c9f62008-04-02 21:24:37 +000079</tr>
kpriceef160682006-08-29 18:08:31 +000080
kpriceb59c9f62008-04-02 21:24:37 +000081</thead>
kpriceef160682006-08-29 18:08:31 +000082
kpriceb59c9f62008-04-02 21:24:37 +000083<tbody>
84<tr>
85<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add DTD Information</td>
kpriceef160682006-08-29 18:08:31 +000086
kpriceb59c9f62008-04-02 21:24:37 +000087<td valign="top" width="75.75757575757575%" headers="N100DF ">Associate the XML file with a DTD.</td>
kpriceef160682006-08-29 18:08:31 +000088
kpriceb59c9f62008-04-02 21:24:37 +000089</tr>
kpriceef160682006-08-29 18:08:31 +000090
kpriceb59c9f62008-04-02 21:24:37 +000091<tr>
92<td valign="top" width="24.242424242424242%" headers="N100D8 ">Edit DOCTYPE</td>
kpriceef160682006-08-29 18:08:31 +000093
kpriceb59c9f62008-04-02 21:24:37 +000094<td valign="top" width="75.75757575757575%" headers="N100DF ">Edit the DOCTYPE declaration. Refer to the related task
95for more details. For more information, see <a href="tedtdoc.dita">Editing DOCTYPE declarations</a>.</td>
kpriceef160682006-08-29 18:08:31 +000096
kpriceb59c9f62008-04-02 21:24:37 +000097</tr>
kpriceef160682006-08-29 18:08:31 +000098
kpriceb59c9f62008-04-02 21:24:37 +000099<tr>
100<td valign="top" width="24.242424242424242%" headers="N100D8 ">Edit Namespaces</td>
kpriceef160682006-08-29 18:08:31 +0000101
kpriceb59c9f62008-04-02 21:24:37 +0000102<td valign="top" width="75.75757575757575%" headers="N100DF ">Edit the existing namespace information or create a
103new association with a namespace. Refer to the related task for more details.
104For more information, see <a href="tedtsch.dita">Editing namespace information</a>.</td>
105
106</tr>
107
108<tr>
109<td valign="top" width="24.242424242424242%" headers="N100D8 ">Edit Processing Instruction</td>
110
111<td valign="top" width="75.75757575757575%" headers="N100DF ">Edit the processing instruction. Refer to the related
112task for more details. For more information, see <a href="tedtproc.dita">Editing XML processing instructions</a>.</td>
113
114</tr>
115
116<tr>
117<td valign="top" width="24.242424242424242%" headers="N100D8 ">Remove</td>
118
119<td valign="top" width="75.75757575757575%" headers="N100DF ">Remove the item that you have selected from the XML
120file. If the selected item or related items are defined so that the item must
121exist in the file, this option will not be available. For example, in your
122DTD, if you have declared that "One or more" of the item must always exist
123in your XML file, and the item you have selected is the only one that exists
124in your XML file.</td>
125
126</tr>
127
128<tr>
129<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add Attribute</td>
130
131<td valign="top" width="75.75757575757575%" headers="N100DF ">Add an attribute to the element that you selected. Any
132attributes you are allowed to add to the element will be listed. After you
133have added the attribute to the XML file, you can click in the right-hand
134column to change the value of the attribute. If the attribute has set values,
135they will appear in a list.</td>
136
137</tr>
138
139<tr>
140<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add Child</td>
141
142<td valign="top" width="75.75757575757575%" headers="N100DF ">Add another element, a comment, or a processing instruction
143as a child of the parent element.</td>
144
145</tr>
146
147<tr>
148<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add Before</td>
149
150<td valign="top" width="75.75757575757575%" headers="N100DF ">Add a child element, comment, or processing instruction
151that can go before the item you have selected. For example, if you have a
152parent element called <kbd class="userinput">CD Collections</kbd> that can contain
153an unlimited amount of children called <kbd class="userinput">CD</kbd>, you could
154click a <kbd class="userinput">CD</kbd> element and click <span class="menucascade"><span class="uicontrol">Add
155Before</span> &gt; <span class="uicontrol"> CD</span></span> , as a <kbd class="userinput">CD</kbd> element
156can go before another <kbd class="userinput">CD</kbd> element.</td>
157
158</tr>
159
160<tr>
161<td valign="top" width="24.242424242424242%" headers="N100D8 ">Add After</td>
162
163<td valign="top" width="75.75757575757575%" headers="N100DF ">Add a child element, comment, or processing instruction
164that can go after the item you have selected. For example, if you have a parent
165element called <kbd class="userinput">CD Collections</kbd> that can contain an unlimited
166amount of children called <kbd class="userinput">CD</kbd>, you could click a <kbd class="userinput">CD</kbd> element
167and click <span class="menucascade"><span class="uicontrol">Add After</span> &gt; <span class="uicontrol"> CD</span>
168</span>, as a <kbd class="userinput">CD</kbd> element can go after another <kbd class="userinput">CD</kbd> element.</td>
169
170</tr>
171
172<tr>
173<td valign="top" width="24.242424242424242%" headers="N100D8 ">Replace With</td>
174
175<td valign="top" width="75.75757575757575%" headers="N100DF ">Replace one item with another. This option is not available
176if you turn grammar constraints off or if there are no valid alternatives
177for you to replace the item with.</td>
178
179</tr>
180
181</tbody>
182
183</table>
184</div>
185</div>
kpriceef160682006-08-29 18:08:31 +0000186
187<div class="section"><p>Any changes you make in the Design view are also reflected in the
syeshinbefd53e2005-07-27 18:16:40 +0000188Source view and the Outline view.</p>
kpriceb59c9f62008-04-02 21:24:37 +0000189<div class="note"><span class="notetitle">Note:</span> These instructions were written
190for the Resource perspective, but they will also work in many other perspectives.</div>
syeshinbefd53e2005-07-27 18:16:40 +0000191</div>
kpriceef160682006-08-29 18:08:31 +0000192
syeshinbefd53e2005-07-27 18:16:40 +0000193</div>
194
kpriceef160682006-08-29 18:08:31 +0000195<div><div class="relconcepts"><strong>Related concepts</strong><br />
syeshind0bdb8e2005-10-27 17:44:14 +0000196<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
197<div><a href="../topics/cxmlcat.html" title="When an XML file is associated with a DTD or XML schema, it is bound by any structural rules contained in the DTD or XML schema. To be considered a valid XML file, a document must be accompanied by a DTD or an XML schema, and conform to all of the declarations in the DTD or the XML schema.">XML file associations with DTDs and XML schemas</a></div>
kpriceef160682006-08-29 18:08:31 +0000198</div>
199<div class="reltasks"><strong>Related tasks</strong><br />
syeshind0bdb8e2005-10-27 17:44:14 +0000200<div><a href="../topics/txedtsrc.html" title="You can use the Source view to view and work with a file's source code directly.">Editing in the Source view</a></div>
201<div><a href="../topics/tedtdoc.html" title="The DOCTYPE declaration in an XML file is used at the beginning of it to associate it with a DTD file. You can edit your DOCTYPE declaration to change the DTD file your XML file is associated with.">Editing DOCTYPE declarations</a></div>
kpriceef160682006-08-29 18:08:31 +0000202<div><a href="../topics/tedtsch.html" title="Your namespace information is used to provide various information about the XML file, such as the XML schema and namespace it is associated with. If desired, you can change the schema and namespace your XML file is associated with or add a new association. Modifying any associations can impact what content is allowed in the XML file.">Editing namespace information</a></div>
kpriceb59c9f62008-04-02 21:24:37 +0000203<div><a href="../topics/tedtproc.html" title="If you have instructions you want to send to an application using an XML document, you can use a processing instruction.">Editing XML processing instructions</a></div>
kpriceef160682006-08-29 18:08:31 +0000204</div>
205<div class="relref"><strong>Related reference</strong><br />
syeshind0bdb8e2005-10-27 17:44:14 +0000206<div><a href="../topics/rxmlbicons.html" title="The following XML editor icons appear in the Outline and Design view.">Icons used in the XML editor</a></div>
kpriceef160682006-08-29 18:08:31 +0000207</div>
208</div>
209
syeshinbefd53e2005-07-27 18:16:40 +0000210</body>
211</html>