Scope and visibility

EDMexpressX defines the scope rules as in the EXPRESS language. The global scope of an EDMexpressX mapping schema is the sum of the outer scope of the Source Schema, Target Schema, and mapping schema.

The general visibility rules in EDMexpressX are exactly like the visibility rules in the EXPRESS language. The exception is the visibility of attributes within the body of map and compose declarations.

Attribute reference within map and compose declarations

Generally an attribute reference must be qualified by a local or global variable that identifies the actual instance, or by the extended entity reference name that defines a particular instance type. An unqualified attribute reference can be used in the body of map and compose declarations as long as the unqualified attribute reference is unambiguous, i.e., the following conditions must be true.
There must not be an identifier in the global scope of the mapping schema with the same name as the actual unqualified attribute name.
Unqualified attribute names used on the left hand side of an assignment statement, or in a NEW or DELETE statement, must be unique within the scope of the ENTITY which defines the type of the instance to be mapped or composed. Note that the scope of this ENTITY is the scope of the entity itself plus the scopes of its supertypes.
Unqualified attribute names used on the right hand side of an assignment statement, or such names used in other statements than the NEW and DELETE statements, must be unique within the scope defined by the FROM clause of the current map or compose. That is, the attribute names must be unique within the scopes of all entities listed in the FROM clause as well as within the scopes of all supertypes of the said entities. Moreover, in the presence of the SUBTYPE keyword the scope defined by the FROM clause includes all subtypes of the actual entity as well.