Eclipse 简明教程

Eclipse - Create XML File

Opening the New XML File wizard

  1. 您可以使用“新建 XML 文件”向导创建 XML 文件。要调用此向导 −

You can use the New XML file wizard to create an XML file. To invoke this wizard −

  1. Click on the File menu and select New → Other or

  2. Click on the new drop down box () select other or

  3. Press ctrl + N

  1. “选择向导”对话框出现后 −

Once the Select a wizard dialog box comes up −

  1. In the filter text box enter xml, this should show only the wizards related to xml.

  2. Expand XML category and select XML File.

new xml file new wiz
  1. Click on Next to bring up the New XML File wizard.

Note

  1. 如果 XML 视角处于打开状态,则可以通过以下方式调用“新建 XML”向导 −

If the XML perspective is open the New XML wizard can be invoked by −

  1. Clicking on the File menu and selecting New → XML File or.

  2. Clicking on the XML File button ( ) on the tool bar.

Using the New XML File wizard

新 XML 文件向导出现后,执行以下操作:

Once the New XML File wizard comes up −

  1. Enter or select the parent folder.

  2. Enter the name of the xml file.

new xml file new wiz 2
  1. Click on the Next button to base the xml file on DTD, XML Schema or XML template else click on Finish.

Viewing the Newly Created XML File

新创建的 XML 文件应出现在包资源管理器视图中,一个允许您修改新创建的 XML 文件的 XML 编辑器实例应出现在编辑器区域中。

The newly created XML file should appear in the Package Explorer view and an XML editor instance that allows you to modify the newly created XML file should appear in the editor area.

new xml file pe

XML 编辑器允许您使用设计视图或代码视图编辑 XML 文件。

The XML editor allows you to edit an XML file using either the Design view or Source view.