blob: ecca417a350afee17755069f4985c70b5a5563b4 [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, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.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, 2009" />
<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 in the Source view" />
<meta name="abstract" content="You can use the Source view to view and work with a file's source code directly." />
<meta name="description" content="You can use the Source view to view and work with a file's source code directly." />
<meta content="XML editor, Source view" name="DC.subject" />
<meta content="XML editor, Source view" 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/cxmlcat.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/twcdast.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/twmacro.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/ttaghilt.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="txedtsrc" 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 in the Source view</title>
<body id="txedtsrc"><a name="txedtsrc"><!-- --></a>
<h1 class="topictitle1">Editing in the Source view</h1>
<div><p>You can use the Source view to view and work with a file's source
code directly.</p>
<div class="section"><p> The Source view has many text editing features, such as:</p>
<dt class="dlterm">Syntax highlighting</dt>
<dd>Each tag type is highlighted differently, enabling you to easily find
a certain kind of tag for editing. In addition, syntax highlighting is valuable
in locating syntax errors. For example, if you begin a comment in the middle
of the document with <samp class="codeph">&lt;!--</samp> everything until the next <samp class="codeph">--&gt;</samp> is
considered a comment, and will be highlighted accordingly. The large highlighted
area will indicate that you need to add <samp class="codeph">--&gt;</samp> to close the
comment.<p>You can customize the syntax highlighting. Refer to the related
tasks for more information.</p>
<dt class="dlterm">Unlimited undo and redo</dt>
<dd>These options allow you to incrementally undo and redo every change made
to a file for the entire editing session. For text, changes are incremented
one character or set of selected characters at a time.</dd>
<dt class="dlterm">Content assist</dt>
<dd>Content assist helps you finish tags and insert macros. Refer to the related
task for more details.</dd>
<dt class="dlterm">Template</dt>
<dd>You can access templates (using content assist) to help you quickly add
regularly-used tagging combinations. Refer to the related task for more details.</dd>
<dt class="dlterm">Node selection</dt>
<dd>Based on the location of your cursor (or selection in the Outline view),
the node selection indicator highlights the line numbers that include a node
(for example, an element or attribute), in the vertical ruler in the left
area of the Source view.</dd>
<dt class="dlterm">Pop-up menu options</dt>
<dd>From the editor's pop-up menu, you have many of the same editing options
available as you do from the workbench <strong>Edit</strong> menu. You can select menu
options such as: <span class="uicontrol">Cleanup Document,</span> to open the <span class="uicontrol">Cleanup</span>
dialog, which contains settings to update a document so that it is well-formed
and formatted and <span class="uicontrol">Format,</span> which formats either the
entire document or selected elements.</dd>
<dt class="dlterm">"Smart" double clicking</dt>
<dd>You can use double-click to select attribute values, attribute-value pairs,
and entire tag sets to quickly update, copy, or remove content.</dd>
<p>To open an XML file to edit, right-click the file in the
Navigator view and select <span class="uicontrol">Open With &gt; XML Editor</span>. Click
the <span class="uicontrol">Source</span> to see the Source view.</p>
<p>Edit the code
as necessary, using any of the available features. As you move the cursor
within your XML file (or select items from the Outline view), the node selection
indicator will highlight the line numbers that encompass the node (for example,
an element or attribute). You can use smart double-clicking behavior to select
attribute values, attribute-value pairs, and entire tag sets to quickly update,
copy, or remove content. If desired, validate and save the XML
<div class="section"><p>Any changes you make in the Source view are also reflected in the
Design view and the Outline view.</p>
<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><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>
<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 with Node and Content columns 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/twcdast.html" title="You can use content assist to help you finish a tag or line of code in the Source view of the XML editor. You can also use content assist to insert templates into your XML code.">Using XML content assist</a></div>
<div><a href="../topics/twmacro.html" title="XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time.">Working with XML templates</a></div>
<div><a href="../topics/ttaghilt.html" title="If desired, you can change various aspects of how the XML source code is displayed in the Source view of the XML editor, such as the colors the tags will be displayed in.">Setting source highlighting styles</a></div>