Example

Given an XTT file with the following object tree structure:

<?xml version="1.0" encoding="US-ASCII"?>

<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="NUM" value="$CARD_SQL0.NUM"/> 

                        <xtt:attribute name="FIRSTNAME" value="$CARD_SQL0.FIRSTNAME"/> 

                        <xtt:attribute name="LASTNAME" value="$CARD_SQL0.LASTNAME"/>

                        <xtt:attribute name="TITLE" value="$CARD_SQL0.TITLE"/> 

                        <BMP xtt:textvalue="$CARD_SQL0.BMP" /> 

                </CARD> 

        </root> 

</xtt:template>

The resultant schema file structure will be:

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="root">

        <xsd:complexType> 

                <xsd:sequence> 

                        <xsd:element ref="CARD" maxOccurs="unbounded"/> 

                </xsd:sequence> 

        </xsd:complexType> 

</xsd:element>

<xsd:element name="CARD">

        <xsd:complexType> 

                <xsd:sequence> 

                        <xsd:element ref="BMP" /> 

                </xsd:sequence> 

          <xsd:attribute name="NUM" type="xsd:int"/> 

          <xsd:attribute name="FIRSTNAME" type="xsd:string"/> 

          <xsd:attribute name="LASTNAME" type="xsd:string"/> 

          <xsd:attribute name="TITLE" type="xsd:string"/>

          </xsd:complexType> 

</xsd:element>

<xsd:element name="BMP" type="xsd:string"/>

</xsd:schema>