blob: 57be5279ae8e7c83c4762c7179a56ff3db426a0e [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="Using XML content assist" />
<meta name="abstract" content="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." />
<meta name="description" content="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." />
<meta content="XML editor, content assist, XML files" name="DC.subject" />
<meta content="XML editor, content assist, XML files" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/twmacro.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/tsugstrat.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="twcdast" 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>Using XML content assist</title>
<body id="twcdast"><a name="twcdast"><!-- --></a>
<h1 class="topictitle1">Using XML content assist</h1>
<div><p>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.</p>
<div class="section"><p>The placement of the cursor in your source file provides the context
for the content assist to offer suggestions for completion.</p>
<p>You can
launch content assist in either of the following ways:</p>
<li>From the <span class="uicontrol">Edit</span> menu, click <span class="uicontrol">Content Assist</span>,
<li>Press Ctrl+Space</li>
<p>In addition, you can set up an option that causes content assist to
pop up automatically when certain characters are typed. To set up this option,
click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol"> Preferences</span>
</span> to open the Preferences window, then select <span class="menucascade"><span class="uicontrol">XML</span>
&gt; <span class="uicontrol">XML Files </span> &gt; <span class="uicontrol">Editor</span></span> .
In the <span class="uicontrol">Content assist</span> group box, select the <span class="uicontrol">Automatically
make suggestions</span> check box, and supply any additional characters
that should trigger content assist.</p>
<p>If your cursor is in a position
where content assist is available, a pop-up list of available choices is displayed
when you launch content assist. The list is based on the context and whether
a DTD or XML schema is associated with the XML file being edited. For example,
if you have an Address element that can contain any of the following children
elements: Name, Street, City, Zip Code, Country, and Province, and you place
your cursor after any of them and launch content assist, all of the child
elements will be listed in the content assist list.</p>
<p>The content assist
list displays all valid tags for the current cursor position, including templates.
If your grammar constraints are turned off, all available tags, not just valid
ones, are displayed. </p>
<p>As you type the first one or two letters of the
tag that you want, the list automatically refreshes with alphabetized choices
that match your input. Scroll down and select the tag that you want to use
by double-clicking on it.</p>
<div class="note"><span class="notetitle">Note:</span> The list only refreshes as
described if you first type <kbd class="userinput">&lt;</kbd> before prompting for
content assist.</div>
<div><div class="reltasks"><strong>Related tasks</strong><br />
<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>
<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/tsugstrat.html" title="You can customize the formatting of the suggestions given by content assist by choosing a suggestion strategy preference. When the suggestion strategy is set to Strict, suggestions that are grammatically valid will be displayed first in the list of options and highlighted by bold icons. Other suggestions that are applicable to this element's scope but are not grammatically valid will be displayed lower in the list with de-emphasized icons. When the suggestion strategy is set to Lax, all suggestions will displayed in the list with de-emphasized icons.">Setting the XML source suggestion strategy used by content assist</a></div>