blob: 1b7cacb1aa12d4dab775dfb249a4cf01faeb6fa3 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<!-- /*******************************************************************************
* Copyright (c) 2000, 2005 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
*******************************************************************************/ -->
<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
<title>Using XML content assist</title>
<script language="JavaScript">
function popup_window( url, id, width, height )
popup = url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=' + width + ',height=' + height + ',left=,top=' );
</script><script language="JavaScript" src="help/liveHelp.js"></script></head>
<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 macros into your XML code. The placement of the cursor in your source
file provides the context for the content assist to offer suggestions for
completion.</p><div class="skipspace"><p>You can launch content assist in any of the following ways:</p>
<ul><li>From the <b> <span class="uicontrol">Edit</span></b> menu, click <b> <span class="uicontrol">Content Assist</span>,</b>
<li>Press <b>Ctrl+Space</b></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 <b> <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol"> Preferences</span></span></b> to open the Preferences window, then click
<b> <span class="menucascade"><span class="uicontrol">Web
and XML</span> &gt; <span class="uicontrol">XML Files </span> &gt; <span class="uicontrol">XML Source</span></span></b>. In the
<b> <span class="uicontrol">Content assist</span> </b>group box, select
the <b> <span class="uicontrol">Automatically make suggestions</span></b> 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
<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> </p>
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.</p>
The list only refreshes as described if you first type <kbd class="userinput">&lt;</kbd> before
prompting for content assist.</p>
<p>Scroll down and select the tag that you
want to use by double-clicking on it. </p>
<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 chunk 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>