Project Schema Overview

This reference provides the information necessary to understand the structure and individual elements of the Microsoft Office Project 2003 XML Schema. In addition to descriptions for each element within the schema, the overall structure of the schema is detailed, and some sample macros are included that show how to use the XML Document Object Model (DOM) to access the Project XML Schema.

Note  To ensure that all required elements and default settings are included when you create a project in XML, it is recommended that you start by saving an empty project to XML that you can use as a template.

Appending XML Data to Existing Projects

When Project appends XML data to an existing project, a summary task's unique ID is incremented from 0 to 1. Project then checks for duplicate, unique IDs elsewhere in the appended XML data; if any are found, they are given new, unique IDs. This process can cause assignments, tasks, resources, and cross-project links to become disassociated with original data.

Note  To ensure that data doesn't end up in unintended locations, it is recommended that you separate this data into its smallest possible component: a task, a resource, an assignment, and so on, before appending. You can also create a custom solution by using Project Visual Basic for Applications (VBA) and MSXML. See Project VBA Help for more information.

For examples of using VBA in Project to open and save XML data, see Using XML Files with Project.

Project XML Element and Data Types

The following XML Schema Definition (XSD) element types are used in the Project XML Schema:

Element Types Description
schema Contains the definition of the schema.
annotation Defines an annotation.
complexType A type definition for elements that contains elements and attributes. This data can contain elements and attributes.
documentation Specifies information to be read or used by users within the annotation element.
sequence Requires the elements in the group to appear in the specified sequence within the containing element.
element Declares an element.
simpleType A type definition for a value that can be used as the content of an element or attribute. This data type cannot contain elements or have attributes.
restriction Defines constraints on a simpleType definition.
enumeration A specified set of values for an element. Data is constrained to the specific values described.

The following data types are used in the Project XML Schema:

Data Types Description
integer A sequence of decimal digits with an optional leading sign (+ or -). This data type is derived from decimal.
float A single-precision, 32-bit floating point number.
string A character string.
datetime A specific instance of time.
time An instance of time that recurs every day.
duration A duration of time.
Boolean A Boolean value, which is either True or False.
decimal An arbitrary precision number.
TimephasedDataType A complex data type that contains information about a task, resource, or assignment that is distributed over time. The <TimephasedData> element is of this type.

The Project XML Schema

The topics in this XML Schema reference explain each individual element of the Project XML Schema. The schema is broken into sections by concept of data in relation to how it exists in Project, Microsoft Office Project Server 2003, and the OLE databases, rather than being based on the literal organization of the actual schema itself. For example:

<xsd:element name="Project">
   <xsd:complexType>
      <xsd:sequence>
         <xsd:element name="UID" minOccurs="0">
            <xsd:simpleType>
               <xsd:restriction base="xsd:string">
                  <xsd:maxLength value="16" />
               </xsd:restriction>
            </xsd:simpleType>
         </xsd:element>
         <xsd:element name="CreationDate">
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
</xsd:element>

The elements in the example shown above are included in the topic XML Structure for the <Project> Element. The <UID> and <CreationDate> elements each have their own topic descriptions, which may be referenced from the XML Structure list or from the Alphabetical List of Elements and Types.

The <UID> element is a child not only of <Project>, but also of several other complex types, such as <Calendar>, <Resource>, <Assignment>, and <Task>. The topic description of each element includes a list of its parent elements.

Here is another, more complex example:

<xsd:element name="Calendars">
...
   <xsd:element name="Weekday">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="DayWorking" minOccurs="0">
            <xsd:element name="DayType" minOccurs="0">
            ...
            <xsd:element name="WorkingTimes" minOccurs="0">
            ...
               <xsd:complexType>
                  <xsd:sequence>
                     <xsd:choice>
                        <xsd:element name="WorkingTime" minOccurs="0" maxOccurs="5">
                        ...
                           <xsd:element name="FromTime" minOccurs="0">
                           <xsd:element name="ToTime" minOccurs="0">
            ...
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
...
</xsd:element>

Links to the element topics in the example shown above are included in the topic XML Structure for the <Calendar> Element , and in Alphabetical List of Elements and Types. The <WorkingTimes> element (note the plural form) is a collection of the singular <WorkingTime> element, which is defined by <FromTime> and <ToTime>. In general, it is easier to see the parent-child relationships in the XML Structure topics, rather than in the schema itself.