blob: 16864cefcd54fce463c0c43452c241d1674f5524 [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>
16<keywords><indexterm>XML files<indexterm>generating from DTDs</indexterm></indexterm>
kpriceb59c9f62008-04-02 21:24:37 +000017<indexterm>DTD<indexterm>generating XML files</indexterm></indexterm></keywords>
kpriceef160682006-08-29 18:08:31 +000018</metadata></prolog>
19<taskbody>
20<context><p>After you have generated your XML file, you can further customize
21it in the XML editor.</p><p>The following instructions were written for the
22Resource perspective, but they will also work in many other perspectives.</p><p>To
kpriceb59c9f62008-04-02 21:24:37 +000023create an XML file from a DTD file, complete the following steps:</p></context>
kpriceef160682006-08-29 18:08:31 +000024<steps>
25<step><cmd>In the Navigator view, right-click the DTD file that you want to
kpriceb59c9f62008-04-02 21:24:37 +000026work with and select <menucascade><uicontrol>Generate</uicontrol><uicontrol>XML
27File</uicontrol></menucascade>.</cmd></step>
kpriceef160682006-08-29 18:08:31 +000028<step><cmd>Select a project or folder to contain the XML file and type a name
kpriceb59c9f62008-04-02 21:24:37 +000029for the file in the <uicontrol>File Name</uicontrol> field, then click <uicontrol>Next</uicontrol>.</cmd>
30<info>The name of the file must end in <userinput>.xml</userinput>.</info>
kpriceef160682006-08-29 18:08:31 +000031</step>
kpriceef160682006-08-29 18:08:31 +000032<step><cmd>Select the <uicontrol>Root element</uicontrol> of the XML file.</cmd>
33<info>The root element of an XML file is the element that contains all other
34elements in that file. All the elements that you have defined in the DTD will
35be shown in the <uicontrol>Root element</uicontrol> list.</info></step>
36<step><cmd>Select from the following content options: </cmd>
37<choices>
kpriceb59c9f62008-04-02 21:24:37 +000038<choice><uicontrol>Create optional attributes</uicontrol>: both mandatory
kpriceef160682006-08-29 18:08:31 +000039and optional attributes will be generated.</choice>
kpriceb59c9f62008-04-02 21:24:37 +000040<choice><uicontrol>Create optional elements</uicontrol>: both mandatory and
kprice9623e9d2007-05-03 03:43:05 +000041optional elements will be generated.</choice>
kpriceb59c9f62008-04-02 21:24:37 +000042<choice><uicontrol>Create first choice of required choice</uicontrol>: the
kpriceef160682006-08-29 18:08:31 +000043first option of a required choice will be generated in your XML file.</choice>
kpriceb59c9f62008-04-02 21:24:37 +000044<choice><uicontrol>Fill elements and attributes with data</uicontrol>:<?Pub Caret?>
45any elements and attributes generated will be filled with sample data.</choice>
kpriceef160682006-08-29 18:08:31 +000046</choices>
kpriceb59c9f62008-04-02 21:24:37 +000047<info> If you do not select any of these options, then only the minimum amount
48of content required for the XML file will be created.</info></step>
kpriceef160682006-08-29 18:08:31 +000049<step><cmd>Specify the <uicontrol>Public ID</uicontrol> or <uicontrol>System
50ID</uicontrol>.</cmd><info>You do not need to specify both. If you do, the
51Public ID will be used before the System ID. </info></step>
52<step><cmd>Click <uicontrol>Finish</uicontrol>.</cmd></step>
53</steps>
54<result><p>The XML file will only contain the selected root element and any
55elements or attributes contained in the root element. You can now add elements,
56attributes, entities, and notations to the XML file, however, they must follow
57the rules established in the DTD that you used to create the XML file.</p></result>
58</taskbody>
59</task>
kpriceb59c9f62008-04-02 21:24:37 +000060<?Pub *0000003391?>