kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 2 | <!--Arbortext, Inc., 1988-2006, v.4002-->
|
| 3 | <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
|
| 4 | "task.dtd">
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 5 | <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
|
| 11 | create an XML file based on your DTD file. Generating an XML file from your
|
| 12 | DTD saves you time by creating an XML file that is already associated with
|
| 13 | your DTD, and contains at least some of the elements and attributes in your
|
| 14 | DTD.</shortdesc>
|
| 15 | <prolog><metadata>
|
| 16 | <keywords><indexterm>XML files<indexterm>generating from DTDs</indexterm></indexterm>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 17 | <indexterm>DTD<indexterm>generating XML files</indexterm></indexterm></keywords>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 18 | </metadata></prolog>
|
| 19 | <taskbody>
|
| 20 | <context><p>After you have generated your XML file, you can further customize
|
| 21 | it in the XML editor.</p><p>The following instructions were written for the
|
| 22 | Resource perspective, but they will also work in many other perspectives.</p><p>To
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 23 | create an XML file from a DTD file, complete the following steps:</p></context>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 24 | <steps>
|
| 25 | <step><cmd>In the Navigator view, right-click the DTD file that you want to
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 26 | work with and select <menucascade><uicontrol>Generate</uicontrol><uicontrol>XML
|
| 27 | File</uicontrol></menucascade>.</cmd></step>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 28 | <step><cmd>Select a project or folder to contain the XML file and type a name
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 29 | for 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>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 31 | </step>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 32 | <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
|
| 34 | elements in that file. All the elements that you have defined in the DTD will
|
| 35 | be shown in the <uicontrol>Root element</uicontrol> list.</info></step>
|
| 36 | <step><cmd>Select from the following content options: </cmd>
|
| 37 | <choices>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 38 | <choice><uicontrol>Create optional attributes</uicontrol>: both mandatory
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 39 | and optional attributes will be generated.</choice>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 40 | <choice><uicontrol>Create optional elements</uicontrol>: both mandatory and
|
kprice | 9623e9d | 2007-05-03 03:43:05 +0000 | [diff] [blame] | 41 | optional elements will be generated.</choice>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 42 | <choice><uicontrol>Create first choice of required choice</uicontrol>: the
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 43 | first option of a required choice will be generated in your XML file.</choice>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 44 | <choice><uicontrol>Fill elements and attributes with data</uicontrol>:<?Pub Caret?>
|
| 45 | any elements and attributes generated will be filled with sample data.</choice>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 46 | </choices>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 47 | <info> If you do not select any of these options, then only the minimum amount
|
| 48 | of content required for the XML file will be created.</info></step>
|
kprice | ef16068 | 2006-08-29 18:08:31 +0000 | [diff] [blame] | 49 | <step><cmd>Specify the <uicontrol>Public ID</uicontrol> or <uicontrol>System
|
| 50 | ID</uicontrol>.</cmd><info>You do not need to specify both. If you do, the
|
| 51 | Public 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
|
| 55 | elements or attributes contained in the root element. You can now add elements,
|
| 56 | attributes, entities, and notations to the XML file, however, they must follow
|
| 57 | the rules established in the DTD that you used to create the XML file.</p></result>
|
| 58 | </taskbody>
|
| 59 | </task>
|
kprice | b59c9f6 | 2008-04-02 21:24:37 +0000 | [diff] [blame] | 60 | <?Pub *0000003391?>
|