<?xml version="1.0" encoding="GB2312"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="funcs">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="func" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="func">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="in"/>
                <xs:element ref="out"/>
                <xs:element ref="col" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute name="id" type="xs:int" use="required"/>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="channel" type="xs:string" use="required"/>
            <xs:attribute name="protocol" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="json"/>
                        <xs:enumeration value="structs"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="topic" type="xs:string" use="required"/>
            <xs:attribute name="autoAudit" type="xs:byte" use="required"/>
            <xs:attribute name="cmdName" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="field" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="field" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="col">
        <xs:complexType mixed="true">
            <xs:sequence>
                <xs:element ref="field" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="field">
        <xs:complexType>
            <xs:attribute name="id" type="xs:string" use="required"/>
            <xs:attribute name="type" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="string"/>
                        <xs:enumeration value="int"/>
                        <xs:enumeration value="double"/>
                        <xs:enumeration value="cursor"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="length" type="xs:string" />
            <xs:attribute name="name" type="xs:string" use="required"/>
        </xs:complexType>
    </xs:element>
</xs:schema>
