blob: 10952609bf11c93ee579a3d1d8d9b41fae8630f8 [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 Source view" />
12<meta name="abstract" content="You can use the Source view to view and work with a file's source code directly." />
13<meta name="description" content="You can use the Source view to view and work with a file's source code directly." />
kpriceb59c9f62008-04-02 21:24:37 +000014<meta content="XML editor, Source view" name="DC.subject" />
15<meta content="XML editor, Source 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/txedtdes.html" />
18<meta scheme="URI" name="DC.Relation" content="../topics/cxmlcat.html" />
19<meta scheme="URI" name="DC.Relation" content="../topics/twcdast.html" />
20<meta scheme="URI" name="DC.Relation" content="../topics/twmacro.html" />
21<meta scheme="URI" name="DC.Relation" content="../topics/ttaghilt.html" />
22<meta content="XHTML" name="DC.Format" />
23<meta content="txedtsrc" name="DC.Identifier" />
24<meta content="en-us" name="DC.Language" />
25<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
syeshinbefd53e2005-07-27 18:16:40 +000026<title>Editing in the Source view</title>
syeshin66078272005-09-20 16:53:38 +000027</head>
syeshinbefd53e2005-07-27 18:16:40 +000028<body id="txedtsrc"><a name="txedtsrc"><!-- --></a>
29
kpriceef160682006-08-29 18:08:31 +000030
syeshinbefd53e2005-07-27 18:16:40 +000031<h1 class="topictitle1">Editing in the Source view</h1>
kpriceef160682006-08-29 18:08:31 +000032
33
34
35
syeshinbefd53e2005-07-27 18:16:40 +000036<div><p>You can use the Source view to view and work with a file's source
kpriceef160682006-08-29 18:08:31 +000037code directly.</p>
38
39<div class="section"><p> The Source view has many text editing features, such as:</p>
40<dl>
41
42<dt class="dlterm">Syntax highlighting</dt>
43
syeshinbefd53e2005-07-27 18:16:40 +000044<dd>Each tag type is highlighted differently, enabling you to easily find
45a certain kind of tag for editing. In addition, syntax highlighting is valuable
46in locating syntax errors. For example, if you begin a comment in the middle
47of the document with <samp class="codeph">&lt;!--</samp> everything until the next <samp class="codeph">--&gt;</samp> is
48considered a comment, and will be highlighted accordingly. The large highlighted
49area will indicate that you need to add <samp class="codeph">--&gt;</samp> to close the
50comment.<p>You can customize the syntax highlighting. Refer to the related
51tasks for more information.</p>
52</dd>
kpriceef160682006-08-29 18:08:31 +000053
syeshinbefd53e2005-07-27 18:16:40 +000054</dl>
kpriceef160682006-08-29 18:08:31 +000055<dl>
56<dt class="dlterm">Unlimited undo and redo</dt>
57
syeshinbefd53e2005-07-27 18:16:40 +000058<dd>These options allow you to incrementally undo and redo every change made
59to a file for the entire editing session. For text, changes are incremented
60one character or set of selected characters at a time.</dd>
kpriceef160682006-08-29 18:08:31 +000061
62
63<dt class="dlterm">Content assist</dt>
64
kpriceb59c9f62008-04-02 21:24:37 +000065<dd>Content assist helps you finish tags and insert macros. Refer to the related
66task for more details.</dd>
kpriceef160682006-08-29 18:08:31 +000067
68
69<dt class="dlterm">Template</dt>
70
syeshinbefd53e2005-07-27 18:16:40 +000071<dd>You can access templates (using content assist) to help you quickly add
syeshind0bdb8e2005-10-27 17:44:14 +000072regularly-used tagging combinations. Refer to the related task for more details.</dd>
kpriceef160682006-08-29 18:08:31 +000073
74
75<dt class="dlterm">Node selection</dt>
76
syeshinbefd53e2005-07-27 18:16:40 +000077<dd>Based on the location of your cursor (or selection in the Outline view),
78the node selection indicator highlights the line numbers that include a node
79(for example, an element or attribute), in the vertical ruler in the left
80area of the Source view.</dd>
kpriceef160682006-08-29 18:08:31 +000081
82
83<dt class="dlterm">Pop-up menu options</dt>
84
syeshinbefd53e2005-07-27 18:16:40 +000085<dd>From the editor's pop-up menu, you have many of the same editing options
kpriceef160682006-08-29 18:08:31 +000086available as you do from the workbench <strong>Edit</strong> menu. You can select menu
87options such as: <span class="uicontrol">Cleanup Document,</span> to open the <span class="uicontrol">Cleanup</span>
syeshinbefd53e2005-07-27 18:16:40 +000088dialog, which contains settings to update a document so that it is well-formed
kpriceef160682006-08-29 18:08:31 +000089and formatted and <span class="uicontrol">Format,</span> which formats either the
syeshinbefd53e2005-07-27 18:16:40 +000090entire document or selected elements.</dd>
kpriceef160682006-08-29 18:08:31 +000091
92
93<dt class="dlterm">"Smart" double clicking</dt>
94
syeshinbefd53e2005-07-27 18:16:40 +000095<dd>You can use double-click to select attribute values, attribute-value pairs,
96and entire tag sets to quickly update, copy, or remove content.</dd>
kpriceef160682006-08-29 18:08:31 +000097
syeshinbefd53e2005-07-27 18:16:40 +000098</dl>
kpriceb59c9f62008-04-02 21:24:37 +000099<p>To open an XML file to edit, right-click the file in the
100Navigator view and select <span class="uicontrol">Open With &gt; XML Editor</span>. Click
101the <span class="uicontrol">Source</span> to see the Source view.</p>
102<p>Edit the code
103as necessary, using any of the available features. As you move the cursor
104within your XML file (or select items from the Outline view), the node selection
105indicator will highlight the line numbers that encompass the node (for example,
106an element or attribute). You can use smart double-clicking behavior to select
107attribute values, attribute-value pairs, and entire tag sets to quickly update,
108copy, or remove content. If desired, validate and save the XML
109file.</p>
syeshinbefd53e2005-07-27 18:16:40 +0000110</div>
kpriceef160682006-08-29 18:08:31 +0000111
kpriceef160682006-08-29 18:08:31 +0000112<div class="section"><p>Any changes you make in the Source view are also reflected in the
syeshinbefd53e2005-07-27 18:16:40 +0000113Design view and the Outline view.</p>
114</div>
kpriceef160682006-08-29 18:08:31 +0000115
syeshinbefd53e2005-07-27 18:16:40 +0000116</div>
117
kpriceef160682006-08-29 18:08:31 +0000118<div><div class="relconcepts"><strong>Related concepts</strong><br />
119<div><a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files.">XML editor</a></div>
120<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>
121</div>
122<div class="reltasks"><strong>Related tasks</strong><br />
123<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>
syeshind0bdb8e2005-10-27 17:44:14 +0000124<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>
kpriceb59c9f62008-04-02 21:24:37 +0000125<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>
kpriceef160682006-08-29 18:08:31 +0000126<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>
syeshin66078272005-09-20 16:53:38 +0000127</div>
kpriceef160682006-08-29 18:08:31 +0000128</div>
129
syeshinbefd53e2005-07-27 18:16:40 +0000130</body>
131</html>