XML Model Data


One of the supported textual Model File format is the Extensible Markup Language XML Model Data format. The advantages of using this format are:

XML Model Data Structure

An XML Model Data file contains a single tree structure of data in a Project Model. It always starts with an XML header:

<?xml version="1.0"?>

which is followed by the top level <Project Model> element.

Top Level <ProjectModel> Tag

This top level tag indicates the root of the data tree. It has the following attributes from the Project Model:

The top level <ProjectModel> and </ProjectModel> tags encapsulate the following second level elements -- CaseParameter, SimulatorObject, ReferenceObject, and ComponentObject.

Second Level <CaseParameters> Tag

The <CaseParameters> element contains a list of the third level <Case> elements. Each <Case> tag contains exactly one attribute, NUMBER, indicating its 1-based case number.

The <Case> and </Case> tags encapsulate a fourth level <Parameter> element which has case parameter bindings listed as its attributes. The first case should contain all the bindings and the following cases contains only overriding values. When the value of a parameter is not overridden in a case, the binding value of its previous case should be used.

Each Project Model contains at least one case, even though there may be no parameter defined by the user.

Second Level <SimulatorObjects> Tag

The <SimulatorObjects> element contains a third level <Class> element, the simulation control class in the Project Model. Because the XML Model Data is for an external process simulator, the class shown here is the simulation developer defined class derived from the SimControl.XProc class.

The <Class> tag contains two attributes:

Inside the <Class> and </Class> pair, exactly one fourth level <Object> element is contained for the simulation control object of the Project Model.

The <Object> tag has a NAME attribute, for the object name, followed by the values of the attributes defined in the class by the simulation developer. See XML Object Data and XML Data Values below for more details.

The simulation control object may contain logged attributes. The internal code, defined by the simulation developer, of the logged attributes are listed as <LoggedAttribute> elements inside the <Object> element.

Second Level <ReferenceObjects> Tag

The <ReferenceObjects> element contains all the reference classes as <Class> elements in the third level. The classes are listed by the name order as shown in the Tree View in the SansGUI environment. Each class has two attributes, NAME and VERSION, as described in the <SimulatorObjects> tag. Within each class, all the objects derived from the class are listed as the fourth level elements <Object>.

Each <Object> tag has a NAME attribute, for the name of the object. It is followed by the values of attributes defined in the class. See XML Object Data and XML Data Values below for more details.

Some reference object (such as a Collection object) may contain logged attributes. The internal code, defined by the simulation developer, of the logged attributes are listed as <LoggedAttribute> elements inside the <Object> element.

Second Level <ComponentObjects> Tag

Similar to <SimulatorObjects> and <ReferenceObjects> tags, the second level <ComponentObjects> tag contains the third level <Class> elements in which lists of the fourth level <Object> elements may exist to represent the component objects in the Project Model. The <Class> tag has NAME and VERSION attributes as described previously. The <Object> tag contains the NAME of the object followed by all the non-port attributes with values of the named object.

Different from reference objects, component objects may have ports explicitly defined with port attributes. The port attributes of a particular port are listed in a fifth level <Port> tag with the port NUMBER leading them. Each <Port> element represents an explicitly defined port; therefore, there may be more than one <Port> elements.

Also different from the objects in <SimulatorObjects> and <ReferenceObjects>, the component objects do not have any <LoggedAttributes>. They may exist only in parts or links derived from component objects.

Following the <Port> elements, <Part> and <Link> are the other two types of the fifth level elements that may exist inside the <Object> tag of the component object. The <Part> tag contains two attributes -- SERIAL and PATH:

Between the <Part> and </Part> tags, there is a sixth level <Override> element which may contain overriding values of certain attributes found in the part. The overriding values are shown as the values of the attributes in the <Override> element. Also in the sixth level after the <Override> element, there may be <LoggedAttribute> elements indicating the values of these attributes are to be logged during the simulation run.

Similar to <Part> elements, the fifth level <Link> elements describe the contents of Links with an <Override> and, optionally, <LoggedAttribute> elements. The <Link> tag, however, has six attributes:

Summary of XML Model Data Tags

The following is a list of all the tags used in SansGUI XML Model Data files. The leading number in parentheses (n) represent the levels (1-based) of the tags. The built-in attributes names are in upper-case letters. For clarity, only the attribute names are shown. Attributes defined by the simulation developers are listed (not shown) after the built-in attributes. The internal attribute codes are used as their names in the tags. The ellipses (...) show attribute-value pairs for parameter bindings, object values, and overriding values of parts and links.

(1) <ProjectModel NAME DATE TIME SIMULATOR

                             DESCRIPTION ORGANIZATION

                             GENERATOR CREATOR>

(2)      <CaseParameters>

(3)            <Case NUMBER>

(4)                  <Parameter ...>

(4)                  </Parameter>

(3)            </Case>

(2)      </CaseParameters>

 

(2)      <SimulatorObjects>

(3)            <Class NAME VERSION>

(4)                  <Object NAME ...>

(5)                        <LoggedAttribute> </LoggedAttribute>

(4)                  </Object>

(3)            </Class>

(2)      </SimulatorObjects>

 

(2)      <ReferenceObjects>

(3)            <Class NAME VERSION>

(4)                  <Object NAME ...>

(5)                        <LoggedAttribute> </LoggedAttribute>

(4)                  </Object>

(3)            </Class>

(2)      </ReferenceObjects>

 

(2)      <ComponentObjects>

(3)            <Class NAME VERSION>

(4)                  <Object NAME ...>

(5)                        <Port NUMBER ...>

(5)                        </Port>

(5)                        <Part SERIAL PATH>

(6)                              <Override ...>

(6)                              </Override>

(6)                              <LoggedAttribute> </LoggedAttribute>

(5)                        </Part>

(4)                  </Object>

(4)                  <Object NAME ...>

(5)                        <Link SERIAL PATH

                                         PART1 PORT1 PART2 PORT2>

(6)                              <Override ...>

(6)                              </Override>

(6)                              <LoggedAttribute> </LoggedAttribute>

(5)                        </Link>

(4)                  </Object>

(3)            </Class>

(2)      </ComponentObjects>

(1) <ProjectModel>

XML Object Data

All the objects derived from the same class are listed as <Object> elements within the <Class> tag. Although line breaks are not significant in XML files, SansGUI uses the Append Line Break flag defined in the attributes in the class schema to start a new line in order to make the file more readable by the human eyes. The NAME of the object leads all the data values without a line break. The data values of an object are written in the following manners:

XML Data Values

Data values in XML Model Data are written as following:



C:\FH_Suite\htmlgifs\home.gif Tabular Data Blocks SansGUI Intrinsic Classes

SansGUI Modeling and Simulation Environment Version 1.2

Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.

http://protodesign-inc.com