| <?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 XML files</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="txedttag"><a name="txedttag"><!-- --></a> |
| |
| <h1 class="topictitle1">Editing XML files</h1> |
| <div><div class="skipspace"><p>To open an XML file in the XML editor, right-click it in the Navigator |
| view and click <span class="menucascade"><span class="uicontrol">Open With</span> > <span class="uicontrol">XML |
| Editor</span></span>. To make the XML editor the default editor |
| for XML files, select <span class="uicontrol">Window > Preferences > Workbench > File Associations</span>, |
| then select <span class="uicontrol">*.xml</span> and <span class="uicontrol">XML Editor</span> from |
| the Associated Editors list. Click <span class="uicontrol">OK</span>. </p> |
| <p>We |
| recommend working in the Resource perspective when you are developing XML |
| files. The views that appear by default in this perspective (such as |
| the Outline view) help facilitate XML development.</p> |
| <p>The XML editor enables |
| you to directly edit XML files. There are several different views you |
| can use to edit your files:</p> |
| <ul><li><b>Source view</b> - you can manually insert, edit, and delete elements |
| and attributes in the Source view of the XML editor. To facilitate this effort, |
| you can use content assist while you are in the Source view.</li> |
| <li><b>Design view</b> - you can insert, delete, and edit elements, attributes, |
| comments, and processing instructions in this view.</li> |
| <li><b>Properties view</b> - you can edit attribute values in this view.</li> |
| <li><b>Outline view </b>- you can insert, delete, and edit elements, |
| comments, and processing instructions in this view.</li> |
| </ul> |
| <p>Often, you may find that you have more than one way to perform a specific |
| task. For example, you have an XML file "MySchoolSubjects.xml" associated |
| with an XML schema file "SchoolSubjects.xsd" which list all the subjects taught |
| in a school. You want to insert a new element "Math" into your file. You can |
| do so the following ways:</p> |
| <ul><li>In the Outline or Design view, right-click the appropriate parent element |
| and select <span class="uicontrol">Math</span> from the <span class="uicontrol">Add Child</span> pop-up |
| menu. </li> |
| <li>In the Source view, use content assist to help you find the appropriate |
| location and code for the <span class="uicontrol">Math</span> element.</li> |
| <li>In the Source view, type the code for the <span class="uicontrol">Math</span> element |
| in the file.</li> |
| </ul> |
| </div> |
| </div> |
| |
| <p> |
| (C) Copyright IBM Corporation 2000, 2005. All Rights Reserved. |
| </p> |
| </body> |
| </html> |