blob: 31a37c1f56d5468809f0575fb8e9e82f91ae851b [file] [log] [blame]
<?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">
<html>
<head>
<!-- /*******************************************************************************
* Copyright (c) 2000, 2005 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
*******************************************************************************/ -->
<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
<title>Editing XML files</title>
</head>
<body id="txedttag"><a name="txedttag"><!-- --></a>
<h1 class="topictitle1">Editing XML files</h1>
<div><p>This file contains information about editing XML files.</p>
<div><div class="skipspace"><p>To open an XML file in the XML editor, right-click it in the Navigator
view and click <b> <span class="menucascade"><span class="uicontrol">Open With</span> &gt; <span class="uicontrol">XML
Editor</span></span></b>. </p>
<p>We
recommend working in the Resource perspective when you are developing XML
files. The views that appear by default in this perspective (such as
the Outline view) help facilitate XML development.</p>
<p>The XML editor enables
you to directly edit XML files. There are several different views you
can use to edit your files:</p>
<ul><li><b>Source view</b> - you can manually insert, edit, and delete elements
and attributes in the Source view of the XML editor. To facilitate this effort,
you can use content assist while you are in the Source view.</li>
<li><b>Design view</b> - you can insert, delete, and edit elements, attributes,
comments, and processing instructions in this view.</li>
<li><b>Outline view </b>- you can insert, delete, and edit elements,
comments, and processing instructions in this view.</li>
</ul>
<p>Often, you may find that you have more than one way to perform a specific
task. For example, you have an XML file "MySchoolSubjects.xml" associated
with an XML schema file "SchoolSubjects.xsd" which list all the subjects taught
in a school. You want to insert a new element "Math" into your file. You can
do so the following ways:</p>
<ul><li>In the Outline or Design view, right-click the appropriate parent element
and select <span class="uicontrol">Math</span> from the <b> <span class="uicontrol">Add Child</span></b>
pop-up menu.</li>
<li>In the Source view, use content assist to help you find the appropriate
location and code for the <span class="uicontrol">Math</span> element.</li>
<li>In the Source view, type the code for the <span class="uicontrol">Math</span> element
in the file.</li>
</ul>
</div>
<p class="section">The following links provide more information about the XML editor
and editing XML files:</p>
</div>
<p><div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
</p>
<p class="reltasks"><strong>Related tasks</strong><br />
<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>
<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>
</p></body>
</html>