blob: 600d4f746a47e236758f059d7bfcf62f9f832940 [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" />
kprice888ac552010-05-11 21:19:48 +00005<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 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, 2009" />
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
kprice888ac552010-05-11 21:19:48 +000033<div><p>You can use content assist to help you finish a tag or
34line of code in the Source view of the XML editor. You can also use
35content assist to insert templates into your XML code.</p>
kpriceef160682006-08-29 18:08:31 +000036
kprice888ac552010-05-11 21:19:48 +000037<div class="section"><p>The placement of the cursor in your source file provides
38the context for the content assist to offer suggestions for completion.</p>
39<p>You
40can launch content assist in either of the following ways:</p>
kpriceef160682006-08-29 18:08:31 +000041<ul>
kprice888ac552010-05-11 21:19:48 +000042<li>From the <span class="uicontrol">Edit</span> menu, click <span class="uicontrol">Content
43Assist</span>, or</li>
kpriceef160682006-08-29 18:08:31 +000044
45<li>Press Ctrl+Space</li>
46
syeshinbefd53e2005-07-27 18:16:40 +000047</ul>
kprice888ac552010-05-11 21:19:48 +000048<p>In addition, you can set up an option that causes content
49assist to pop up automatically when certain characters are typed.
50To set up this option, click <span class="menucascade"><span class="uicontrol">Window</span>
51 &gt; <span class="uicontrol"> Preferences</span></span> to open the Preferences
52window, then select <span class="menucascade"><span class="uicontrol">XML</span> &gt; <span class="uicontrol">XML
53Files </span> &gt; <span class="uicontrol">Editor</span> &gt; <span class="uicontrol">Content
54assist</span></span> . Select the <span class="uicontrol">Automatically
55make suggestions</span> check box, and supply any additional
56characters that should trigger content assist.</p>
57<p>If your cursor
58is in a position where content assist is available, a pop-up list
59of available choices is displayed when you launch content assist.
60The list is based on the context and whether a DTD or XML schema is
61associated with the XML file being edited. For example, if you have
62an Address element that can contain any of the following children
63elements: Name, Street, City, Zip Code, Country, and Province, and
64you place your cursor after any of them and launch content assist,
65all of the child elements will be listed in the content assist list.</p>
66<p>Content
67assist cycling is available in the XML editor, offering multiple pages
68of content assist. You can set preferences for the proposal categories
69and the cycle order when repeatedly invoking content assist </p>
70<p>The content assist list displays all valid tags for the
71current cursor position, including templates. If your grammar constraints
72are turned off, all available tags, not just valid ones, are displayed. </p>
73<p>As
74you type the first one or two letters of the tag that you want, the
75list automatically refreshes with alphabetized choices that match
76your input. Scroll down and select the tag that you want to use by
77double-clicking on it.</p>
78<div class="note"><span class="notetitle">Note:</span> The list only refreshes as described
79if you first type <kbd class="userinput">&lt;</kbd> before prompting for
kpriceb59c9f62008-04-02 21:24:37 +000080content assist.</div>
syeshinbefd53e2005-07-27 18:16:40 +000081</div>
kpriceef160682006-08-29 18:08:31 +000082
syeshinbefd53e2005-07-27 18:16:40 +000083</div>
kpriceef160682006-08-29 18:08:31 +000084
syeshind0bdb8e2005-10-27 17:44:14 +000085<div><div class="reltasks"><strong>Related tasks</strong><br />
86<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 +000087<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>
88<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 +000089</div>
kpriceef160682006-08-29 18:08:31 +000090</div>
91
92</body>
syeshinbefd53e2005-07-27 18:16:40 +000093</html>