Creating XML files Tutorial Creating XML files Tutorial |
By Ella Belisario |
|
This tutorial demonstrates how you can use XML documents creation wizards that come with the Eclipse Web Tools Platform Project. These wizards allow to create XML document from DTD or XML Schema. |
|
After finishing this tutorial you will be able to do the following: |
|
|
|
Getting Started | |
In order to work with content of this tutorial you will need to download Web Standard Tools package from wtp downloads. |
|
Once you have downloaded WST and prerequisites, unzip them to the same folder and you are ready to go! |
|
Next, launch Eclipse workbench and select File>New>Examples>XML>Editing and validating XML files to bring up the wizard to create a simple project with the sample XML files. |
|
Creating XML files using wizard | |
Creating an XML file from an XML template | |
To create an XML file from a grammar file follow these steps: |
|
|
|
Figure 1: Selecting an XML template: | |
Creating an XML file from DTD or XML Schema | |
Generating an XML file from a DTD or XML Schema can be useful if you want to quickly create an XML file that is based on your gramma file. |
|
To create an XML file from a grammar file follow these steps: |
|
|
|
Figure 2: Selecting Root Element page based on DTD file: | |
Figure 3: Selecting Root Element page based on XML Schema file: | |
When wizard finished the XML file will only contain the selected root element and any elements or attributes contained in the root element. You can now add elements, attributes, entities, and notations to the XML file, however, they must follow the rules established in the DTD or XML Schema file that you used to create the XML file. |