blob: 31adcf579c96870796c741220c5b0c5e997a1ef0 [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>
<link rel="stylesheet" type="text/css" href="../../com.ibm.help.doc/swg_info_common.css" />
<title>XML editor</title>
<script language="JavaScript">
function popup_window( url, id, width, height )
{
popup = window.open( url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=' + width + ',height=' + height + ',left=,top=' );
popup.focus();
}
</script><script language="JavaScript" src="help/liveHelp.js"></script></head>
<body id="cwxmledt"><a name="cwxmledt"><!-- --></a>
<h1 class="topictitle1">XML editor</h1>
<div><p>The XML editor is a tool for creating and viewing XML files</p><p>You can use it to perform a variety of tasks such as the following:</p>
<ul><li>Create new XML files, either from scratch, existing DTDs, or existing
XML schemas</li>
<li>Edit and validate XML files</li>
<li>Import existing XML files for structured viewing</li>
<li>Associate XML files with DTDs or XML schemas</li>
</ul>
<p>To make the XML editor the default editor for XML files, select <span class="uicontrol">Window
&gt; Preferences &gt; Workbench &gt; File Associations</span>, then select <span class="uicontrol">*.xml</span> and <span class="uicontrol">XML
Editor</span> from the Associated Editors list. Click <span class="uicontrol">OK</span>. </p>
<p>The XML editor has two main views - the Source view and the
Design view.</p>
<div class="skipspace"><h4 class="sectiontitle">Source view</h4><p>The Source view enables you to view
and work directly with a file's source code directly.</p>
<p>The Source view has many text editing
features, such as syntax highlighting, unlimited undo/redo, and user-defined
macros. Another helpful feature is content assist, which uses the information
in a DTD or schema content model to provide a list of acceptable continuations
depending on where the cursor is located in an XML file, or what has just
been typed. The XML editor Source view also includes a "smart" double-clicking
behavior. If your cursor is placed in an attribute value, one double-click
selects that value, another double click selects the attribute-value pair,
and a third double-click selects the entire tag. This makes it easier to copy
and paste commonly used pieces of XML.</p>
</div>
<div class="skipspace"><h4 class="sectiontitle">Design view</h4><p>The XML editor also 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 nodes give alternatives
that are valid for that location. For example, the <span class="uicontrol">Add child</span> menu
item will list only those elements from a DTD or XML schema which would be
valid children at that point (as long as grammar constraints are on).</p>
<p>The
Design view is especially helpful if you are new to XML, or need to do form-oriented
editing. For example, you could use the Create XML File wizard to create a
template XML file for a job description form from a job description 
DTD. After those steps are completed, you would only have to fill in the form
data using the Design view.</p>
<p> <b>Note</b>: You can also use the <b>Outline</b> view
to insert and delete elements.</p>
</div>
</div>
<div>
<blockquote>
<div class="ulchildlink"><b><a href="../topics/cwwedtvw.html">XML editor integration with the workbench</a></b><br />
To edit a file using the XML editor, right-click the file in the
Navigator view, and click <span class="uicontrol">Open With &gt; XML Editor</span>. Because
the editor that is last used to open a file becomes the default editor for
that particular file, the XML editor will remain the default
XML editor for that file unless you explicitly change it.</div>
<div class="ulchildlink"><b><a href="../topics/txprefs.html">Defining XML editor preferences</a></b><br />
You can set various preferences for the Source view of the XML editor such as the formatter indentation style, line wrapping rules, and content assist rules.</div>
</blockquote>
<p>
<b class="parentlink">Parent topic:</b> <a href="../topics/txedttag.html" title="">Editing XML files</a><br />
</p>
<p><b class="relconceptshd">Related concepts</b><br />
<a href="../topics/cxmlcat.html" title="There are two different ways to associate XML files with DTDs or XML schemas.">XML file associations with DTDs and XML schemas</a><br />
</p>
<p><b class="reltaskshd">Related tasks</b><br />
<a href="../topics/tcretxml.html" title="You can create a new empty XML file, which you can then edit in the XML editor.">Creating an XML file from scratch</a><br />
<a href="../topics/txedttag.html" title="Editing XML files"></a><br />
<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><br />
<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><br />
<a href="../topics/twxvalid.html" title="Validating XML files"></a><br />
</p>
</div><p>
(C) Copyright IBM Corporation 2000, 2004. All Rights Reserved.
</p>
</body>
</html>