| <?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>Editing in the Source view</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="txedtsrc"><a name="txedtsrc"><!-- --></a> |
| |
| <h1 class="topictitle1">Editing in the Source view</h1> |
| <div><p>You can use the Source view to view and work with a file's source |
| code directly.</p><div class="skipspace"><p> The Source view has many text editing features, such as:</p> |
| <dl><dt class="bold">Syntax highlighting</dt> |
| <dd>Each tag type is highlighted differently, enabling you to easily find |
| a certain kind of tag for editing. In addition, syntax highlighting is valuable |
| in locating syntax errors. For example, if you begin a comment in the middle |
| of the document with <samp class="codeph"><!--</samp> everything until the next <samp class="codeph">--></samp> is |
| considered a comment, and will be highlighted accordingly. The large highlighted |
| area will indicate that you need to add <samp class="codeph">--></samp> to close the |
| comment.<p>You can customize the syntax highlighting. Refer to the related |
| tasks for more information.</p> |
| </dd> |
| </dl> |
| <dl><dt class="bold">Unlimited undo and redo</dt> |
| <dd>These options allow you to incrementally undo and redo every change made |
| to a file for the entire editing session. For text, changes are incremented |
| one character or set of selected characters at a time.</dd> |
| <dt class="bold">Content assist</dt> |
| <dd>Content assist helps you finish tags and insert macros. </dd> |
| <dt class="bold">Template</dt> |
| <dd>You can access templates (using content assist) to help you quickly add |
| regularly-used tagging combinations.</dd> |
| <dt class="bold">Node selection</dt> |
| <dd>Based on the location of your cursor (or selection in the Outline view), |
| the node selection indicator highlights the line numbers that include a node |
| (for example, an element or attribute), in the vertical ruler in the left |
| area of the Source view.</dd> |
| <dt class="bold">Pop-up menu options</dt> |
| <dd>From the editor's pop-up menu, you have many of the same editing options |
| available as you do from the workbench <b>Edit</b> menu. You can select menu |
| options such as: <span class="uicontrol">Cleanup Document,</span> to open the <span class="uicontrol">Cleanup</span> |
| dialog, which contains settings to update a document so that it is well-formed |
| and formatted and <span class="uicontrol">Format,</span> which formats either the |
| entire document or selected elements.</dd> |
| <dt class="bold">"Smart" double clicking</dt> |
| <dd>You can use double-click to select attribute values, attribute-value pairs, |
| and entire tag sets to quickly update, copy, or remove content.</dd> |
| </dl> |
| <p>To edit an XML file in the Source view, follow these steps:</p> |
| </div> |
| <ol><li class="skipspace"><span>Open the XML file you want to work with in the XML editor (right-click |
| the file in the Navigator view and click <span class="uicontrol">Open With > XML Editor</span>). </span> You may need to click the <span class="uicontrol">Source</span> tab. Typically, |
| all that you will need to do to open the file is to double-click it in the |
| Navigator view. If this does not work, right-click it and click <span class="uicontrol">Open |
| With > XML Editor</span>.</li> |
| <li class="skipspace"><span>Edit the code as necessary, using any of the available features.</span> As you move the cursor within your XML file (or select items from the |
| Outline view), the node selection indicator will highlight the line numbers |
| that encompass the node (for example, an element or attribute). You can use |
| smart double-clicking behavior to select attribute values, attribute-value |
| pairs, and entire tag sets to quickly update, copy, or remove content.</li> |
| <li class="skipspace"><span>At intervals, you may wish to format individual nodes, or the entire |
| XML file to restore element and attribute indentation to see nesting hierarchies |
| more clearly in the file.</span></li> |
| <li class="skipspace"><span>If desired, validate and save the XML file.</span></li> |
| </ol> |
| <div class="skipspace"><p>Any changes you make in the Source view are also reflected in the |
| Design view and the Outline view.</p> |
| </div> |
| </div> |
| |
| <div> |
| |
| <p><b class="relconceptshd">Related concepts</b><br /> |
| <a href="../topics/cwxmledt.html" title="The XML editor is a tool for creating and viewing XML files">XML editor</a><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/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 /> |
| </p> |
| </div><p> |
| (C) Copyright IBM Corporation 2000, 2005. All Rights Reserved. |
| </p> |
| </body> |
| </html> |