blob: 178a1aa8b4abc1cf4e0d38b4f9d8e654b784ce7b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html lang="en-us" xml:lang="en-us">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<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 Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "" l gen true r (n 0 s 0 v 0 l 0) "" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Editing XML files" />
<meta name="abstract" content="This file contains information about editing XML files." />
<meta name="description" content="This file contains information about editing XML files." />
<meta content="XML editor, XML files, editing" name="DC.subject" />
<meta content="XML editor, XML files, editing" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/cwxmledt.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/txedtdes.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="txedttag" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Editing XML files</title>
<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 class="section"><p>To open an XML file in the XML editor, right-click it in the Navigator
view and select <span class="menucascade"><span class="uicontrol">Open With</span> &gt; <span class="uicontrol">XML
Editor</span></span>. </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>
XML editor enables you to directly edit XML files. There are several different
views you can use to edit your files:</p>
<li><strong>Source view</strong>: 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><strong>Design view</strong>: you can insert, delete, and edit elements, attributes,
comments, and processing instructions in this view.</li>
<li><strong>Outline view</strong>: you can insert and delete elements attributes, comments,
and processing instructions in this view.</li>
<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 in the following ways:</p>
<li>In the Outline or Design view, right-click the appropriate parent element
and select <span class="menucascade"><span class="uicontrol">Add Child</span> &gt; <span class="uicontrol">Math</span>
</span> or <span class="uicontrol">New Element</span> and enter the name of
the child element.</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>
<div class="section" />
<div><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>
<div 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>