You are here: Part 3: Advanced Concepts > Configuring QoS with XML > Example XML File

Example XML File

The QoS configuration of a Entity can be loaded from an XML file or string.

The file contents must follow an important hierarchy: the file contains one or more libraries; each library contains one or more profiles; each profile contains QoS settings.

Let's look at a very basic configuration file, just to get an idea of its contents. You will learn the meaning of each line as you read the rest of this chapter:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- A XML configuration file -->
<dds version = 5.0.0>
  <qos_library name="RTILibrary">
      <!-- A QoS Profile is a set of related QoS -->
      <qos_profile name="StrictReliableCommunicationProfile">
          <datawriter_qos>
              <history>
                  <kind>KEEP_ALL_HISTORY_QOS</kind>
              </history>
              <reliability>
                  <kind>RELIABLE_RELIABILITY_QOS</kind>
               </reliability>
          </datawriter_qos>
          <datareader_qos>
              <history>
                  <kind>KEEP_ALL_HISTORY_QOS</kind>
              </history>
              <reliability>
                  <kind>RELIABLE_RELIABILITY_QOS</kind>
              </reliability> 
          </datareader_qos>
      </qos_profile>
      <!--Individual QoS are shortcuts for QoS Profiles with 1 QoS->
      <datawriter_qos name="KeepAllWriter">
          <history>
              <kind>KEEP_ALL_HISTORY_QOS</kind>
          </history>
      </datawriter_qos>
  </qos_library>
</dds>

See <NDDSHOME>/resource/xml/NDDS_QOS_PROFILES.example.xml for another example; this file contains the default QoS values for all entity kinds.

© 2016 RTI