skip to main content
Developing with design tools > Using the Designer > XML structure > Content and structure of an XML data file
 
Content and structure of an XML data file
Describes the properties and uses of the Schedule Data eXchange Language (SDXL) elements.
*Overview
*Schedule Data eXchange Language (SDXL)
*The schedule element
*Describes the properties and uses of a schedule element.
*The property element
*Describes the properties and uses of a property element.
*Resources
*Describes the properties and uses of a resources element.
*Activities
*Describes the properties and uses of a activities element.
*Constraints
*Describes the properties and uses of a constraints element.
*Reservations
*Describes the properties and uses of a reservations element.
Overview
Data from an XML data source must comply with the DTD used in the Schedule Data eXchange Language (SDXL). See Document type definition for SDXL in Developing with the SDK.
The XML file used in the examples in Getting started is located in:
<installdir>/jviews-gantt/bin/designer/data/examples/monitorGantt.xml
You can learn more in general about SDXL in The schedule data exchange language in Developing with the SDK.
The schedule element
The schedule element is the root element that contains all the other elements in the XML document. It describes the content of a specific Gantt data model. It therefore contains:
*An activities element
*A resources element
*A constraints element
*A reservations element
Defining the root in XML
<schedule version="5.5">
  <title>Scheduling Data</title>
  <desc>JViews Scheduling Data Exchange Language</desc>
  ...
</schedule>
The schedule element has the following attribute:
 
version
%Text
Required
The version of the SDXL.
The title and desc elements are used to specify extra descriptive information about the schedule element.
The property element
The property element is used to describe user-defined properties added to objects in the Gantt data model. See User-defined properties for more information about how the property element is used.
User-defined types in XML
<activity end="21-10-2003 0:0:0" id="A-1.2"
  name="Write up requirements" start="10-10-2003 0:0:0">
  <property javaClass="java.lang.Float" name="completion">0.75</property>
  <property name="tags">critical</property>
</activity>
The property element has the following attributes:
 
name
%Text
Required
The name of the property.
javaClass
%Text
Implied
The property class name.
Resources
Resources belong to a Schedule chart. A resources element, the root of the resources, groups all resource elements in a schedule element. In other words, there is only one resources element in a schedule element.
A resource element corresponds to a resource object in a Gantt data model.
Defining resources in XML
  <resources>
    <resource id="JCOM" name="A JCompany Employees" quantity="1.0">
      <resource id="MKT" name="Marketing" quantity="1.0">
        <resource id="BM" name="Bill McDonald" quantity="1.0"/>
        <resource id="SJ" name="Steve Knoll" quantity="1.0"/>
        <resource id="MD" name="Michael Smith" quantity="1.0"/>
        <resource id="LG" name="Luc Dupont" quantity="1.0"/>
      </resource>
      <resource id="RnD" name="Research and Development" quantity="1.0">
        <resource id="LT" name="Linus Dane" quantity="1.0"/>
        <resource id="JG" name="James Hook" quantity="1.0"/>
        <resource id="SO" name="Scott Washington" quantity="1.0"/>
        <resource id="GB" name="Grady Happy" quantity="1.0"/>
        <resource id="LW" name="Larry Money" quantity="1.0"/>
      </resource>
    </resource>
  </resources>
A resource element is defined by the following attributes:
 
id
ID
Required
The identifier of a resource must be unique within the set of all activities and resources in the schedule.
name
%Text
Required
The name of the resource.
quantity
%Text
Implied
The number of resources.
A resource element can have any number of property elements.
In the example, the parent resource is defined as the department to which the individual leaf resources, the workers, belong.
Activities
Activities belong to a Gantt chart. An activities element, the root of the activities, groups all activity elements in a schedule element. In other words, there is only one activities element in a schedule element.
<activities dateFormat="d-M-yyyy H:m:s">
    <activity end="19-5-2004 0:0:0" id="A-Root" name="Project Summary"
                                                start="6-10-2003 0:0:0">
      <activity end="21-10-2003 0:0:0" id="A-1"
        name="Gather Requirements" start="6-10-2003 0:0:0">
        <activity end="13-10-2003 0:0:0" id="A-1.1"
          name="Talk to customers" start="6-10-2003 0:0:0">
          <activity end="10-10-2003 0:0:0" id="A-1.1.1"
            name="Compile customer list" start="6-10-2003 0:0:0">
            <property javaClass="java.lang.Float" name="completion">
                    1.0</property>
            <property name="department">marketing</property>
          </activity>
          <activity end="13-10-2003 0:0:0" id="A-1.1.2"
            name="Contact customers" start="9-10-2003 0:0:0">
            <property javaClass="java.lang.Float" name="completion">
                    1.0</property>
            <property name="department">marketing</property>
          </activity>
        </activity>
        <activity end="21-10-2003 0:0:0" id="A-1.2"
          name="Write up requirements" start="10-10-2003 0:0:0">
          <property javaClass="java.lang.Float" name="completion">
                    0.75</property>
          <property name="tags">critical</property>
        </activity>
        <activity end="21-10-2003 0:0:0" id="A-1.3"
          name="Requirements Defined" start="21-10-2003 0:0:0">
          <property name="tags">critical</property>
        </activity>
      </activity>
      <activity end="1-11-2003 0:0:0" id="A-2"
        name="Marketing Specification" start="23-10-2003 0:0:0">
        <activity end="27-10-2003 0:0:0" id="A-2.1"
          name="First Draft Specification" start="23-10-2003 0:0:0">
          <property javaClass="java.lang.Float" name="completion">
                    1.0</property>
          <property name="department">marketing</property>
        </activity>
        <activity end="1-11-2003 0:0:0" id="A-2.2"
          name="Second Draft Specification" start="27-10-2003 0:0:0">
          <property javaClass="java.lang.Float" name="completion">
                    0.95</property>
          <property name="department">marketing</property>
        </activity>
        <activity end="1-11-2003 0:0:0" id="A-2.3" name="Specs Complete"
                   start="1-11-2003 0:0:0">
          <property name="department">marketing</property>
        </activity>
      </activity>
Defining activities in XML
      <activity end="2-12-2003 0:0:0" id="A-3" name="Proof of Concept"
                    start="1-11-2003 0:0:0">
        <activity end="14-11-2003 0:0:0" id="A-3.1" name="Rough Design"
                    start="1-11-2003 0:0:0">
          <activity end="8-11-2003 0:0:0" id="A-3.1.1" name="CAD Layout"
                    start="1-11-2003 0:0:0">
            <property javaClass="java.lang.Float" name="completion">
                    0.3</property>
          </activity>
          <activity end="14-11-2003 0:0:0" id="A-3.1.2" name="Detailing"
                    start="8-11-2003 0:0:0">
            <property javaClass="java.lang.Float" name="completion">
                    0.7</property>
          </activity>
        </activity>
        <activity end="18-11-2003 0:0:0" id="A-3.2"
          name="Fabricate Prototype" start="6-11-2003 0:0:0">
          <activity end="10-11-2003 0:0:0" id="A-3.2.1"
            name="Order Materials" start="6-11-2003 0:0:0">
            <property name="tags">critical</property>
          </activity>
          <activity end="18-11-2003 0:0:0" id="A-3.2.2" name="Machining"
                    start="10-11-2003 0:0:0"/>
        </activity>
        <activity end="25-11-2003 0:0:0" id="A-3.3"
          name="Burn-in Testing" start="20-11-2003 0:0:0"/>
        <activity end="2-12-2003 0:0:0" id="A-3.4" name="Prepare Demo"
                    start="27-11-2003 0:0:0"/>
      </activity>
      <activity end="19-5-2004 0:0:0" id="A-4"
        name="Design and Development" start="2-12-2003 0:0:0">
        <activity end="20-1-2004 0:0:0" id="A-4.1"
          name="Phase I Development" start="2-12-2003 0:0:0">
          <property name="department">engineering</property>
          <property javaClass="java.lang.Float" name="completion">
                    0.85</property>
          <property name="tags">critical</property>
        </activity>
        <activity end="24-2-2004 0:0:0" id="A-4.2"
          name="Phase II Development" start="20-1-2004 0:0:0">
          <property javaClass="java.lang.Float" name="completion">
                    0.65</property>
          <property name="department">engineering</property>
        </activity>
        <activity end="19-5-2004 0:0:0" id="A-4.3"
          name="Phase III Development" start="24-2-2004 0:0:0">
          <property javaClass="java.lang.Float" name="completion">
                    0.1</property>
          <property name="department">engineering</property>
        </activity>
      </activity>
      <activity end="19-5-2004 0:0:0" id="A-5" name="Project Complete"
                    start="19-5-2004 0:0:0"/>
    </activity>
  </activities>
The dateFormat attribute defines the date format used for activities.
An activity element corresponds to an activity object in a Gantt data model. It is used to define a simple activity and is defined by the following attributes:
 
id
ID
Required
The identifier of an activity must be unique within the set of all activities and resources in the schedule.
name
%Text
Required
The name of the activity.
start
%Datetime
Required
The start time of the activity.
end
%Datetime
Required
The end time of the activity.
An activity element can have any number of property elements.
An activity group is defined in the same way as a simple activity, but contains nested simple activity elements. It is the parent activity. In the example, the activity A-1, Gather Requirements, is a parent activity. It has a child activity A-1.1, Talk to customers, which has the leaf activities A-1.1.1, Compile customer list and A-1.1.2, Contact customers.
You can use the root, the activity group, and simple activities to define a hierarchy of tasks in the schedule.
User-defined properties
The property element is used to define your own properties that do not exist in the supplied Gantt data model. These properties can be referred to in style rules for styling your data. In the Style Rule Wizard, these properties are referred to as user-defined types. You write style rules in the Style Rule Wizard of the Designer to customize the styling of your data.
A property element named completion is used to represent the percentage completion of an activity. For example:
Use of the completion property element
        <activity end="24-2-2004 0:0:0" id="A-4.2"
          name="Phase II Development" start="20-1-2004 0:0:0">
            <property javaClass="java.lang.Float" name="completion">
                    0.65</property>
          <property name="department">engineering</property>
        </activity>
Later, when the property element dueDate is introduced, you can use the value of completion to determine whether an activity is on schedule, behind schedule, or even in advance.
The property element can be used to attribute an activity as a task to be performed by a resource, for example, the marketing department.
Distributing tasks to resources
        <activity end="1-11-2003 0:0:0" id="A-2.2"
          name="Second Draft Specification" start="27-10-2003 0:0:0">
          <property javaClass="java.lang.Float" name="completion">
                    0.95</property>
          <property name="department">marketing</property>
        </activity>
In Distributing tasks to resources, the property attribute named "department" is set to marketing for the activity "Second Draft Specification".
The user-defined property with the reserved name tags is used to distinguish the property element used for a user-defined type that will be interpreted as a CSS class for styling purposes. User-defined type in XML shows how to define the user-defined type critical, which is used to distinguish the styling of activities that are in a critical state, so that they can be flagged visually in the schedule.
User-defined type in XML
        <activity end="18-11-2003 0:0:0" id="A-3.2"
          name="Fabricate Prototype" start="6-11-2003 0:0:0">
          <activity end="10-11-2003 0:0:0" id="A-3.2.1"
            name="Order Materials" start="6-11-2003 0:0:0">
            <property name="tags">critical</property>
          </activity>
Constraints
A constraints element, the root element, groups all constraint elements in a schedule element. In other words, there is only one constraints element in a schedule element:
Defining constraints in XML
  <constraints>
    <constraint from="A-4.1" to="A-4.2" type="End-Start"/>
    <constraint from="A-4.2" to="A-4.3" type="End-Start"/>
    <constraint from="A-3.1.1" to="A-3.1.2" type="End-Start"/>
    <constraint from="A-1.1" to="A-1.2" type="End-Start"/>
    <constraint from="A-3.2.1" to="A-3.2.2" type="End-Start"/>
    <constraint from="A-2.1" to="A-2.2" type="End-Start"/>
    <constraint from="A-4" to="A-5" type="End-Start"/>
    <constraint from="A-2" to="A-3" type="End-Start"/>
    <constraint from="A-1" to="A-2" type="End-Start"/>
    <constraint from="A-1.1.1" to="A-1.1.2" type="End-Start"/>
    <constraint from="A-3" to="A-4" type="End-Start"/>
    <constraint from="A-2.2" to="A-2.3" type="End-Start"/>
    <constraint from="A-1.2" to="A-1.3" type="End-Start"/>
  </constraints>
A constraint element can have any number of property elements.
Constraints are used to place dependencies on activities, such as the start of one activity is dependent on the completion of another activity. For this purpose, an activity is described as a From activity or a To activity.
A From activity is the source activity of a constraint. The start or end of such an activity controls the start or end of another activity.
A To activity is the target activity of a constraint. The start or end of such an activity controls the start or end of another activity as the result of the constraint.
In the example, all the constraints are defined as end-to-start constraints, which means that the end of the To activity depends on the start of the From activity.
A constraint element corresponds to a constraint object in a Gantt data model. It has the following attributes:
 
from
%ActivityID
Required
The identifier of the From activity, which must be a valid activity in the same SDXL file.
to
%ActivityID
Required
The identifier of the To activity, which must be a valid activity in the same SDXL file.
type
%ConstraintType
Required
The type of the constraint. It can be:
Start-Start
Start-End
End-Start
End-End
Reservations
A reservations element, the root element, groups all reservation elements in a schedule element. In other words, there is only one reservations element in a schedule element:
Defining reservations in XML
  <reservations>
    <reservation activity="A-4.1" resource="LT"/>
    <reservation activity="A-3.2" resource="LT"/>
    <reservation activity="A-1.1.1" resource="SJ"/>
    <reservation activity="A-1.1.2" resource="BM"/>
    <reservation activity="A-1.1.1" resource="LG"/>
    <reservation activity="A-1.2" resource="MD"/>
    <reservation activity="A-3.4" resource="LG"/>
    <reservation activity="A-4.2" resource="LT"/>
    <reservation activity="A-2.1" resource="LG"/>
    <reservation activity="A-3.2" resource="BM"/>
    <reservation activity="A-4.2" resource="JG"/>
    <reservation activity="A-3.3" resource="SO"/>
    <reservation activity="A-4.3" resource="SO"/>
    <reservation activity="A-4.3" resource="LT"/>
    <reservation activity="A-1.1.1" resource="MD"/>
    <reservation activity="A-4.2" resource="SO"/>
    <reservation activity="A-4.3" resource="JG"/>
    <reservation activity="A-3.1.2" resource="SO"/>
    <reservation activity="A-2.2" resource="MD"/>
    <reservation activity="A-4.3" resource="LW"/>
    <reservation activity="A-3.1.2" resource="JG"/>
    <reservation activity="A-3.1.1" resource="LW"/>
    <reservation activity="A-1.1.2" resource="SJ"/>
    <reservation activity="A-3" resource="RnD"/>
    <reservation activity="A-2.1" resource="MD"/>
    <reservation activity="A-3.1.2" resource="GB"/>
    <reservation activity="A-3.3" resource="SJ"/>
    <reservation activity="A-2.2" resource="LG"/>
    <reservation activity="A-3.4" resource="GB"/>
    <reservation activity="A-3.1.1" resource="JG"/>
    <reservation activity="A-3" resource="BM"/>
    <reservation activity="A-3.4" resource="LW"/>
    <reservation activity="A-4.1" resource="JG"/>
    <reservation activity="A-1.1" resource="MKT"/>
  </reservations>
A reservation ties a resource to a specific activity.
A reservation element corresponds to a reservation object in a Gantt data model. It has the following attributes:
 
activity
%ActivityID
Required
The identifier of the activity, which must be a valid activity in the same SDXL file.
resource
%ResourceID
Required
The identifier of the resource, which must be a valid resource in the same SDXL file.
A reservation element can have any number of property elements.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.