blob: 178a1aa8b4abc1cf4e0d38b4f9d8e654b784ce7b [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 XML files" />
12<meta name="abstract" content="This file contains information about editing XML files." />
13<meta name="description" content="This file contains information about editing XML files." />
kpriceb59c9f62008-04-02 21:24:37 +000014<meta content="XML editor, XML files, editing" name="DC.subject" />
15<meta content="XML editor, XML files, editing" 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/txedtdes.html" />
18<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
19<meta content="XHTML" name="DC.Format" />
20<meta content="txedttag" name="DC.Identifier" />
21<meta content="en-us" name="DC.Language" />
22<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
syeshinbefd53e2005-07-27 18:16:40 +000023<title>Editing XML files</title>
syeshin66078272005-09-20 16:53:38 +000024</head>
syeshinbefd53e2005-07-27 18:16:40 +000025<body id="txedttag"><a name="txedttag"><!-- --></a>
26
kpriceef160682006-08-29 18:08:31 +000027
syeshinbefd53e2005-07-27 18:16:40 +000028<h1 class="topictitle1">Editing XML files</h1>
kpriceef160682006-08-29 18:08:31 +000029
30
31
32
syeshind0bdb8e2005-10-27 17:44:14 +000033<div><p>This file contains information about editing XML files.</p>
kpriceef160682006-08-29 18:08:31 +000034
35<div class="section"><p>To open an XML file in the XML editor, right-click it in the Navigator
kpriceb59c9f62008-04-02 21:24:37 +000036view and select <span class="menucascade"><span class="uicontrol">Open With</span> &gt; <span class="uicontrol">XML
kpriceef160682006-08-29 18:08:31 +000037Editor</span></span>. </p>
38<p>We recommend working in the Resource
39perspective when you are developing XML files. The views that appear by default
40in this perspective (such as the Outline view) help facilitate XML development.</p>
41<p>The
42XML editor enables you to directly edit XML files. There are several different
43views you can use to edit your files:</p>
44<ul>
kpriceb59c9f62008-04-02 21:24:37 +000045<li><strong>Source view</strong>: you can manually insert, edit, and delete elements
syeshinbefd53e2005-07-27 18:16:40 +000046and attributes in the Source view of the XML editor. To facilitate this effort,
47you can use content assist while you are in the Source view.</li>
kpriceef160682006-08-29 18:08:31 +000048
kpriceb59c9f62008-04-02 21:24:37 +000049<li><strong>Design view</strong>: you can insert, delete, and edit elements, attributes,
syeshinbefd53e2005-07-27 18:16:40 +000050comments, and processing instructions in this view.</li>
kpriceef160682006-08-29 18:08:31 +000051
kpriceb59c9f62008-04-02 21:24:37 +000052<li><strong>Outline view</strong>: you can insert and delete elements attributes, comments,
kpriceef160682006-08-29 18:08:31 +000053and processing instructions in this view.</li>
54
syeshinbefd53e2005-07-27 18:16:40 +000055</ul>
56<p>Often, you may find that you have more than one way to perform a specific
57task. For example, you have an XML file "MySchoolSubjects.xml" associated
kpriceef160682006-08-29 18:08:31 +000058with an XML schema file "SchoolSubjects.xsd", which list all the subjects
59taught in a school. You want to insert a new element "Math" into your file.
60You can do so in the following ways:</p>
61<ul>
62<li>In the Outline or Design view, right-click the appropriate parent element
kpriceb59c9f62008-04-02 21:24:37 +000063and select <span class="menucascade"><span class="uicontrol">Add Child</span> &gt; <span class="uicontrol">Math</span>
64</span> or <span class="uicontrol">New Element</span> and enter the name of
65the child element.</li>
kpriceef160682006-08-29 18:08:31 +000066
syeshinbefd53e2005-07-27 18:16:40 +000067<li>In the Source view, use content assist to help you find the appropriate
68location and code for the <span class="uicontrol">Math</span> element.</li>
kpriceef160682006-08-29 18:08:31 +000069
syeshinbefd53e2005-07-27 18:16:40 +000070<li>In the Source view, type the code for the <span class="uicontrol">Math</span> element
71in the file.</li>
kpriceef160682006-08-29 18:08:31 +000072
syeshinbefd53e2005-07-27 18:16:40 +000073</ul>
74</div>
kpriceef160682006-08-29 18:08:31 +000075
kpriceb59c9f62008-04-02 21:24:37 +000076<div class="section" />
kpriceef160682006-08-29 18:08:31 +000077
syeshinbefd53e2005-07-27 18:16:40 +000078</div>
kpriceef160682006-08-29 18:08:31 +000079
80<div><div class="relconcepts"><strong>Related concepts</strong><br />
syeshind0bdb8e2005-10-27 17:44:14 +000081<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
kpriceef160682006-08-29 18:08:31 +000082</div>
83<div class="reltasks"><strong>Related tasks</strong><br />
syeshind0bdb8e2005-10-27 17:44:14 +000084<div><a href="../topics/txedtdes.html" title="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.">Editing in the Design view</a></div>
85<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>
kpriceef160682006-08-29 18:08:31 +000086</div>
87</div>
syeshind0bdb8e2005-10-27 17:44:14 +000088
kpriceef160682006-08-29 18:08:31 +000089</body>
syeshinbefd53e2005-07-27 18:16:40 +000090</html>