Example:
The following is a complete XTT file that maps data from the table CARD. It maps the columns FIRSTNAME, LASTNAME, and TITLE as attributes of the element CARD, and the column NUM as a child element:
<?xml version="1.0"
encoding="UTF-8"?>
<xtt:template xmlns:xtt="urn:schema-dbmaker-com:xml-template">
<root>
<CARD
xtt:query="CARD_SQL0" xtt:command="select NUM, FIRSTNAME, LASTNAME,
TITLE, BMP from SYSADM.CARD">
<xtt:attribute
name="FIRSTNAME" value="$CARD_SQL0.FIRSTNAME"/>
<xtt:attribute
name="LASTNAME" value="$CARD_SQL0.LASTNAME"/>
<xtt:attribute
name="TITLE" value="$CARD_SQL0.TITLE"/>
<NUM
xtt:textvalue="$CARD_SQL0.NUM" />
</CARD>
</root>
</xtt:template>
If the XTT in the above example is run, the following XML file is generated:
<?xml
version="1.0" encoding="US-ASCII" ?>
<root>
<CARD
FIRSTNAME="Eddie"
LASTNAME="Brown"
TITLE="Manager">
<NUM>1</NUM>
</CARD>
</root>
The XTT tool provides a simple user interface for scripting, validating and running XTT files. The following sections describe the user interface, and give procedures to help you quickly learn to start creating your own XTT files.