Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

XInclude support



The supportXInclude property allows to include portions of the XML documents using the xInclude mechanism. It help to define only once an XML structure (such as the interfaces of a module) and reuse them in several configurations.

Note that there is another way to achieve the same result: You can also use use conditions to specify the framework architecture.

Generalities

The way to use included files in an XML file is by:
  • Allow the support of xInclude in the framework properties
  • Define the namespace by adding the xmlns:xi="http://www.w3.org/2001/XInclude" at the root of the XML document
  • Use the xi:include directive by using <xi:include href="includedFile" parse="text"/> or <xi:include href="includedFile" parse="xml"/>


For example:
      <applications xmlns:xi="http://www.w3.org/2001/XInclude">
         <application name="appli1">
            <xi:include href="included.xml" parse="xml"/>
         </application>
      </applications>
Note that the two possible values for the parse attribute ( xml and text) are supported. The text allows to include content as text, whereas the content included with the xml must be well-formed XML.

Example

Suppose that we want to define two configurations for an aircraft application:
  • One where there is only one Aircraft application with the following modules:
    • The InertialNavSystem module computes the current position of the aircraft
    • The FlightManagementSystem module computes the Flight plan and sends the events during the aircraft route on the Flight plan
    • The GuidanceSystem module computes the aircraft trajectory
    • The Cockpit module
  • One where there is only one AircraftSystems application with the following modules:
    • The InertialNavSystem module computes the current position of the aircraft
    • The FlightManagementSystem module computes the Flight plan and sends the events during the aircraft route on the Flight plan
    • The GuidanceSystem module computes the aircraft trajectory
  • And a Cockpit application with only the Cockpit module
As we can see, we could define two applications configuration, but they will share a lot of content. The other way we could use would be to define one file for each module, and reuse these as included files in the two, applications configurations.

Included files

For the InertialNavSystem

We will use the InertialNavSystem.xml file with the following content:
      <module name="InertialNavSystem" >
         <implementation path="org.da.aircraft.ins.INS" >
            <initEntryPoint method="init" />
            <startEntryPoint method="start" />
            <defaultReceiveEntryPoint method="receive" />
            <defaultSendEntryPoint method="send" />
         </implementation>
         <interfaces>
            <push service="position" />
         </interfaces>
       </module>

For the FlightManagementSystem

We will use the FlightManagementSystem.xml file with the following content:
      <module name="FlightManagementSystem" >
         <implementation path="org.da.aircraft.fms.FMS" >
            <initEntryPoint method="init" />
            <startEntryPoint method="start" />
            <defaultReceiveEntryPoint method="receive" />
            <defaultSendEntryPoint method="send" />
         </implementation>
         <interfaces>
             <subscribe service="position"/>
             <eventSend service="flightPlanEvents" />
             <requestReceived service="computeFlightPlan"/>
         </interfaces>
       </module>

For the GuidanceSystem

We will use the FlightManagementSystem.xml file with the following content:
      <module name="GuidanceSystem" >
         <implementation path="org.da.aircraft.guidance.Guidance" >
            <initEntryPoint method="init" />
            <startEntryPoint method="start" />
            <defaultReceiveEntryPoint method="receive" />
            <defaultSendEntryPoint method="send" />
         </implementation>
         <interfaces>
            <eventReceived service="flightPlanEvents" />
            <subscribe service="position"/>
         </interfaces>
       </module>

For the Cockpit

We will use the Cockpit.xml file with the following content:
      <module name="Cockpit" >
         <implementation path="org.da.aircraft.mmi.Cockpit" >
            <initEntryPoint method="init" />
            <startEntryPoint method="start" />
            <defaultReceiveEntryPoint method="receive" />
            <defaultSendEntryPoint method="send" />
         </implementation>
         <interfaces>
            <eventReceived service="flightPlanEvents" />
            <requestSend service="computeFlightPlan"/>
         </interfaces>
       </module>

Configuration with one application

    <applications xmlns:xi="http://www.w3.org/2001/XInclude">
      <application name="Aircraft">
         <deployment>
            <lib url="aircraft.jar" />
         </deployment>
         <modules>
            <xi:include href="InertialNavSystem.xml" parse="xml"/>
            <xi:include href="FlightManagementSystem.xml" parse="xml"/>
            <xi:include href="GuidanceSystem.xml" parse="xml"/>
            <xi:include href="Cockpit.xml" parse="xml"/>
         </modules>
      </application>
    </applications>

Configuration with two applications

For the AircraftSystems:
    <applications xmlns:xi="http://www.w3.org/2001/XInclude">
      <application name="AircraftSystems:">
         <deployment>
            <lib url="AircraftSystems.jar" />
         </deployment>
         <modules>
            <xi:include href="InertialNavSystem.xml" parse="xml"/>
            <xi:include href="FlightManagementSystem.xml" parse="xml"/>
            <xi:include href="GuidanceSystem.xml" parse="xml"/>
         </modules>
      </application>
    </applications>
For the Cockpit:
    <applications xmlns:xi="http://www.w3.org/2001/XInclude">
      <application name="Cockpit:">
         <deployment>
            <lib url="Cockpit.jar" />
         </deployment>
         <modules>
            <xi:include href="Cockpit.xml" parse="xml"/>
         </modules>
      </application>
    </applications>

See also


Categories: config

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence