Previous Topic: Non-Printable Characters in XML FilesNext Topic: Creating Models


XML Schema

An XML schema is a document or a set of documents that defines the structure and legal elements of the XML file. XML schemas can be used to ensure that an XML file is syntactically correct and conforms to the defined schema. This product provides such a schema and uses the schema to validate XML files when they are opened in the tool.

The XML schema in this product is comprised of five files that are stored in the \Doc directory after installation. The following list describes these files:

ERwinSchema.xsd

This is the top level schema. It imports from UDP.xsd, EMX.xsd, and EM2.xsd. Its namespace is http://www.ca.com/ERwin.

UDP.xsd

Contains the schema for UDP definitions. Its namespace is http://www.ca.com/ERwin/UDP.

EMX.xsd

Contains the schema for object hierarchy (EMX). It includes EMXProps.xsd. Its namespace is http://www.ca.com/ERwin/data.

EM2.xsd

Contains the schema for non-transactional data (EM2). Its namespace is http://www.ca.com/ERwin/EM2.

EMXProps.xsd

Contains the schema for object properties and UDP instances. Its namespace is http://www.ca.com/ERwin/data.

The schema files under the \Doc directory are not database specific and represent the entire metamodel. The schema contains all possible objects and properties for all valid database targets. If you need a database specific schema, those files are located in the Doc\DBMS_schemas directory. Within the Doc\DBMS_schemas directory, there is a folder for each target database that this product supports. The database specific schema files are stored in that folder and only consist of objects and properties that are valid for the given database target.

Note: The XML schema located in the \Doc directory is always used when an XML file is being validated, not a database specific schema. The database specific schemas are provided for documentation purposes and to assist third party tool integrators to determine the valid objects and properties for a given database target. An external XML validation tool can be used to validate an XML file against a database specific schema.

When you save a model in XML format, the XML output is structured according to the markup declarations defined in the r7 XML Schema. It is not necessary to understand every aspect of the r7 XML markup, but understanding some aspects of the XML Schema will enable you to use the XML output more easily. For example, you can quickly review the children of the Model element in your XML output to identify the model type, target server, and DBMS version.

The following excerpt from the r7 XML Schema defines the element Model as well as its child element ModelEnvProps:

- <xs:element name="Model">

- <xs:complexType>

- <xs:all>

- <xs:element minOccurs="1" maxOccurs="1" name="ModelEnvProps">

- <xs:complexType>

- <xs:all>

<xs:element minOccurs="0" maxOccurs="1" name="Locator" type="xs:string" />

<xs:element minOccurs="0" maxOccurs="1" name="Disposition" type="xs:string" />

<xs:element minOccurs="0" maxOccurs="1" name="Persistence_Unit_Id" type="xs:string" />

<xs:element minOccurs="0" maxOccurs="1" name="Model_Id" type="xs:string" />

<xs:element minOccurs="0" maxOccurs="1" name="Model_Type" type="xs:nonNegativeInteger" />

<xs:element minOccurs="0" maxOccurs="1" name="Active_Model" type="xs:integer" />

<xs:element minOccurs="0" maxOccurs="1" name="Hidden_Model" type="xs:integer" />

<xs:element minOccurs="0" maxOccurs="1" name="Storage_Format" type="xs:integer" />

<xs:element minOccurs="0" maxOccurs="1" name="Target_Server" type="xs:integer" />

<xs:element minOccurs="0" maxOccurs="1" name="Target_Server_Version" type="xs:integer" />

<xs:element minOccurs="0" maxOccurs="1" name="Target_Server_Minor_Version" type="xs:integer" />

</xs:all>

</xs:complexType>

</xs:element>

Each attribute can receive a value in the tagged data. For example, the following XML output is generated for a Physical model with Oracle 10g assigned as the Target DBMS:

<EMX:Model id="{27E38352-ABCC-4793-AC53-DD79F8FA490E}+00000000" name="Model_1" xmlns="

http://www.ca.com/erwin/data">

<ModelEnvProps>

<Locator>erwin://C:\Oracle.xml</Locator>

<Disposition>Read Only = Yes;</Disposition>

<Persistence_Unit_Id>{E74F3A15-3FC9-4581-8B4E-6C57AF948DAA}+00000000</Persistence_Unit_Id>

<Model_Type>3</Model_Type>

<Target_Server>1075858979</Target_Server>

<Target_Server_Version>10</Target_Server_Version>

<Target_Server_Minor_Version>0</Target_Server_Minor_Version>

<Active_Model>-1</Active_Model>

<Hidden_Model>0</Hidden_Model>

<Storage_Format>4012</Storage_Format>

</ModelEnvProps>

Unique numeric values are used for each attribute, as illustrated in the following summary tables.

Model_Type table

Value

Model Type

1

logical model

2

physical model

3

logical/physical model

Target_Server table

Database

Target_Server Value

Target_Server Version Value

Target_Server_Minor_Version Value

DB2 UDB 8.x/9.x

1075858977

8

1

DB2 z/OS 7

1075858978

7

0

DB2 z/OS 8/9

1075858978

8

0

Informix 7.x

1075859006

7

0

Informix 9.x/10.x/11.x

1075859006

9

2

iSeries 5.x

1075859019

4

0

MySQL 5.x

1075859129

5

0

ODBC/Generic 2.0

1075859009

2

0

ODBC/Generic 3.0

1075859009

3

0

Oracle 9.x

1075858979

9

0

Oracle 10.x/11.x

1075858979

10

0

Progress 9.x/10.x

1075859010

9

0

SAS

1075859013

0

0

SQL Server 2000

1075859016

8

0

SQL Server 2005/2008

1075859016

9

0

Sybase 12.5/15

1075859017

12

5

Sybase IQ 12.x

1075859130

12

5

Teradata 2.6

1075859018

2

6

Teradata 12

1075859018

12

0

Caution: You should be careful not to modify any of the values for the Target_Server, Target_Server_Version, or Target_Server_Minor_Version tags. If you do so, this product may be unable to open the file again.

More information:

XML Format