blob: 57be5279ae8e7c83c4762c7179a56ff3db426a0e [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="Using XML content assist" />
12<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." />
13<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." />
kpriceb59c9f62008-04-02 21:24:37 +000014<meta content="XML editor, content assist, XML files" name="DC.subject" />
15<meta content="XML editor, content assist, XML files" name="keywords" />
kpriceef160682006-08-29 18:08:31 +000016<meta scheme="URI" name="DC.Relation" content="../topics/txedtsrc.html" />
17<meta scheme="URI" name="DC.Relation" content="../topics/twmacro.html" />
18<meta scheme="URI" name="DC.Relation" content="../topics/tsugstrat.html" />
19<meta content="XHTML" name="DC.Format" />
20<meta content="twcdast" name="DC.Identifier" />
21<meta content="en-us" name="DC.Language" />
22<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
syeshinbefd53e2005-07-27 18:16:40 +000023<title>Using XML content assist</title>
kpriceef160682006-08-29 18:08:31 +000024</head>
syeshinbefd53e2005-07-27 18:16:40 +000025<body id="twcdast"><a name="twcdast"><!-- --></a>
26
kpriceef160682006-08-29 18:08:31 +000027
syeshinbefd53e2005-07-27 18:16:40 +000028<h1 class="topictitle1">Using XML content assist</h1>
kpriceef160682006-08-29 18:08:31 +000029
30
31
32
syeshinbefd53e2005-07-27 18:16:40 +000033<div><p>You can use content assist to help you finish a tag or line of
34code in the Source view of the XML editor. You can also use content assist
kpriceef160682006-08-29 18:08:31 +000035to insert templates into your XML code.</p>
36
37<div class="section"><p>The placement of the cursor in your source file provides the context
38for the content assist to offer suggestions for completion.</p>
39<p>You can
40launch content assist in either of the following ways:</p>
41<ul>
42<li>From the <span class="uicontrol">Edit</span> menu, click <span class="uicontrol">Content Assist</span>,
syeshinbefd53e2005-07-27 18:16:40 +000043or</li>
kpriceef160682006-08-29 18:08:31 +000044
45<li>Press Ctrl+Space</li>
46
syeshinbefd53e2005-07-27 18:16:40 +000047</ul>
48<p>In addition, you can set up an option that causes content assist to
49pop up automatically when certain characters are typed. To set up this option,
kpriceef160682006-08-29 18:08:31 +000050click <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol"> Preferences</span>
kpriceb59c9f62008-04-02 21:24:37 +000051</span> to open the Preferences window, then select <span class="menucascade"><span class="uicontrol">XML</span>
52 &gt; <span class="uicontrol">XML Files </span> &gt; <span class="uicontrol">Editor</span></span> .
53In the <span class="uicontrol">Content assist</span> group box, select the <span class="uicontrol">Automatically
54make suggestions</span> check box, and supply any additional characters
55that should trigger content assist.</p>
56<p>If your cursor is in a position
57where content assist is available, a pop-up list of available choices is displayed
58when you launch content assist. The list is based on the context and whether
59a DTD or XML schema is associated with the XML file being edited. For example,
60if you have an Address element that can contain any of the following children
61elements: Name, Street, City, Zip Code, Country, and Province, and you place
62your cursor after any of them and launch content assist, all of the child
63elements will be listed in the content assist list.</p>
64<p>The content assist
65list displays all valid tags for the current cursor position, including templates.
66If your grammar constraints are turned off, all available tags, not just valid
67ones, are displayed. </p>
68<p>As you type the first one or two letters of the
69tag that you want, the list automatically refreshes with alphabetized choices
70that match your input. Scroll down and select the tag that you want to use
71by double-clicking on it.</p>
72<div class="note"><span class="notetitle">Note:</span> The list only refreshes as
73described if you first type <kbd class="userinput">&lt;</kbd> before prompting for
74content assist.</div>
syeshinbefd53e2005-07-27 18:16:40 +000075</div>
kpriceef160682006-08-29 18:08:31 +000076
syeshinbefd53e2005-07-27 18:16:40 +000077</div>
kpriceef160682006-08-29 18:08:31 +000078
syeshind0bdb8e2005-10-27 17:44:14 +000079<div><div class="reltasks"><strong>Related tasks</strong><br />
80<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>
kpriceb59c9f62008-04-02 21:24:37 +000081<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>
82<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>
syeshind0bdb8e2005-10-27 17:44:14 +000083</div>
kpriceef160682006-08-29 18:08:31 +000084</div>
85
86</body>
syeshinbefd53e2005-07-27 18:16:40 +000087</html>