Editing DAD files

You may want to edit a DAD file if you have moved your document type definition (DTD) file, or need to otherwise modify the output of the DAD Generator.

To open your DAD file in the default editor, double-click the file in the Navigator view. The editor provides basic functions like highlighting and find and replace.

You may wish to modify the following nodes:

Consider the following code sample:

<?xml version ="1.0"?> 
<!DOCTYPE DAD SYSTEM "/home/dxxinst/dtd/dad.dtd"> 
<DAD> 
<dtdid>/home/samples/dtd/neworder.dtd</dtdid> 
<validation>NO</validation> 
<Xcollection> 
<prolog>?xml version="1.0"?</prolog> 
<doctype>!DOCTYPE Order SYSTEM "/home/samples/dtd/neworder.dtd"</doctype> 
<root_node> 
<element_node name="Order"> 
    <RDB_node> 
        <table name="order_tab" key="order_key1 order_key2 order_key3"/> 
        <table name="part_tab" key="part_key1 part_key2"/>
        <table name="ship_tab" key="date"/> 
         <condition>order_tab.order_key1= order_tab.order_key1</condition>  
    </RDB_node> 
    .
    .
    .

The following table explains how to edit the code:

Code Modification
<!DOCTYPE DAD SYSTEM "/home/dxxinst/dtd/dad.dtd"> Modify this line to change the location of the DTD file for the DAD document.
<dtdid>/home/samples/dtd/neworder.dtd</dtd>

<doctype>!DOCTYPE Order SYSTEM "/home/samples/dtd/neworder.dtd"</doctype>

Modify these lines to change the location of the DTD file for the XML document.
<validation>NO</validation> Modify this line to change the validation indicator.
<element_node name="Order"> Modify this line to change the top element representing the root XML element.

<table name="order_tab" key="order_key1 order_key2 order_key3"/>
<table name="part_tab" key="part_key1 part_key2"/>
<table name="ship_tab" key="date"/>

Modify these lines to add an orderBy attribute to the table element.

 

Parent topic

Generating DAD files

 

Related concepts

DAD script

 

Related tasks

Generating DAD files
Running DAD files with the DB2 XML Extender

Related reference
The generated DAD script