<?xml version="1.0" encoding="UTF-8"?>
<!--
 (c) Copyright, Real-Time Innovations, 2012-2016.
 All rights reserved.
 Permission to modify and use for internal purposes granted.
 This software is provided "as is", without warranty, express or implied.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified">

    <xs:include schemaLocation="definitions/rti_dds_profiles_definitions.xsd"/>

    <xs:complexType name="application">
        <xs:sequence>
            <xs:element name="domain_participant"
                        type="participant"
                        minOccurs="0"
                        maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

     <xs:complexType name="webIntegrationService">
        <xs:sequence>
            <xs:element name="application"
                        type="application"
                        minOccurs="0"
                        maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:element name="dds">
        <xs:complexType>
            <xs:choice minOccurs="0"
                       maxOccurs="unbounded">
                <!-- User Env -->
                <xs:element name="configuration_variables"
                            type="KeyValuePairSeq">
                    <xs:annotation>
                        <xs:documentation>
                          <![CDATA[
                          Defines a set of default values for user variables.
                          The values specified in this section can be overridden
                          by environment variables.
                          ]]>
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="qos_library"
                                type="qosLibrary"/>
                <xs:element name="types">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:group ref="moduleElements"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>

                <xs:element name="domain_library"
                                type="domainLibrary"/>
                <xs:element name="domain_participant_library"
                                type="participantLibrary"
                                maxOccurs="unbounded"/>
                <xs:element name="web_integration_service"
                                type="webIntegrationService"/>
            </xs:choice>
            <xs:attribute name="version"
                          type="xs:string"
                          use="optional"
                          default="6.0.0">
                <xs:annotation>
                    <xs:documentation>
                        <![CDATA[
                        Specifies the version number of the XML Schema which is
                        tied to the RTI Connext DDS Professional or RTI Connext DDS Secure
                        version number.
                        ]]>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

</xs:schema>
