blob: e1efde51cb1a8b9f2b89460ddb17d1e6231d812d [file] [log] [blame]
kpriceef160682006-08-29 18:08:31 +00001<?xml version="1.0" encoding="utf-8"?>
kpriceb59c9f62008-04-02 21:24:37 +00002<!--Arbortext, Inc., 1988-2006, v.4002-->
3<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "task.dtd">
kpriceef160682006-08-29 18:08:31 +00005<task id="tcrexdtd" xml:lang="en-us">
6<title>Generating XML files from DTDs</title>
7<titlealts>
8<searchtitle>Generate an XML file from a DTD</searchtitle>
9</titlealts>
10<shortdesc>You can generate an XML file from your DTD if you want to quickly
11create an XML file based on your DTD file. Generating an XML file from your
12DTD saves you time by creating an XML file that is already associated with
13your DTD, and contains at least some of the elements and attributes in your
14DTD.</shortdesc>
15<prolog><metadata>
kprice02ec4b02008-05-14 23:26:58 +000016<keywords><indexterm keyref="tcrexdtd|1|XMLfilesgeneratingfromDTDs" status="new">XML
17files<indexterm>generating from DTDs</indexterm></indexterm><indexterm keyref="tcrexdtd|2|DTDgeneratingXMLfiles"
18status="changed">DTDs<indexterm>generating XML files</indexterm></indexterm>
19</keywords>
kpriceef160682006-08-29 18:08:31 +000020</metadata></prolog>
21<taskbody>
22<context><p>After you have generated your XML file, you can further customize
23it in the XML editor.</p><p>The following instructions were written for the
24Resource perspective, but they will also work in many other perspectives.</p><p>To
kpriceb59c9f62008-04-02 21:24:37 +000025create an XML file from a DTD file, complete the following steps:</p></context>
kpriceef160682006-08-29 18:08:31 +000026<steps>
27<step><cmd>In the Navigator view, right-click the DTD file that you want to
kpriceb59c9f62008-04-02 21:24:37 +000028work with and select <menucascade><uicontrol>Generate</uicontrol><uicontrol>XML
29File</uicontrol></menucascade>.</cmd></step>
kpriceef160682006-08-29 18:08:31 +000030<step><cmd>Select a project or folder to contain the XML file and type a name
kpriceb59c9f62008-04-02 21:24:37 +000031for the file in the <uicontrol>File Name</uicontrol> field, then click <uicontrol>Next</uicontrol>.</cmd>
32<info>The name of the file must end in <userinput>.xml</userinput>.</info>
kpriceef160682006-08-29 18:08:31 +000033</step>
kpriceef160682006-08-29 18:08:31 +000034<step><cmd>Select the <uicontrol>Root element</uicontrol> of the XML file.</cmd>
35<info>The root element of an XML file is the element that contains all other
36elements in that file. All the elements that you have defined in the DTD will
37be shown in the <uicontrol>Root element</uicontrol> list.</info></step>
38<step><cmd>Select from the following content options: </cmd>
39<choices>
kpriceb59c9f62008-04-02 21:24:37 +000040<choice><uicontrol>Create optional attributes</uicontrol>: both mandatory
kpriceef160682006-08-29 18:08:31 +000041and optional attributes will be generated.</choice>
kpriceb59c9f62008-04-02 21:24:37 +000042<choice><uicontrol>Create optional elements</uicontrol>: both mandatory and
kprice9623e9d2007-05-03 03:43:05 +000043optional elements will be generated.</choice>
kpriceb59c9f62008-04-02 21:24:37 +000044<choice><uicontrol>Create first choice of required choice</uicontrol>: the
kpriceef160682006-08-29 18:08:31 +000045first option of a required choice will be generated in your XML file.</choice>
kprice02ec4b02008-05-14 23:26:58 +000046<choice><uicontrol>Fill elements and attributes with data</uicontrol>: any
47elements and attributes generated will be filled with sample data.</choice>
kpriceef160682006-08-29 18:08:31 +000048</choices>
kpriceb59c9f62008-04-02 21:24:37 +000049<info> If you do not select any of these options, then only the minimum amount
50of content required for the XML file will be created.</info></step>
kpriceef160682006-08-29 18:08:31 +000051<step><cmd>Specify the <uicontrol>Public ID</uicontrol> or <uicontrol>System
52ID</uicontrol>.</cmd><info>You do not need to specify both. If you do, the
53Public ID will be used before the System ID. </info></step>
54<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd></step>
55</steps>
56<result><p>The XML file will only contain the selected root element and any
57elements or attributes contained in the root element. You can now add elements,
58attributes, entities, and notations to the XML file, however, they must follow
59the rules established in the DTD that you used to create the XML file.</p></result>
60</taskbody>
61</task>