Figure 5-6 Pop-up on schema file in the Outline view

Making changes and referential integrity

As a schema becomes bigger and more complex, there will be more type definitions, and references to those types. So what happens after you have defined a type, created ten references to that type, and you want to change the name of the type? The XML Schema editor has a built-in referential integrity mechanism that will propagate the changes automatically, freeing you from the tedious and error-prone task of doing the manual updates.

Let us assume that in your xsd file, you have defined a simple type called SimpleType1. There is a reference to this type in the complex type named ComplexType1. Let us say we want to change the simple type name from SimpleType1 to SimpleType2.The following illustrates how to do that:

￿Switch to the Design view.

￿Select the SimpleType1 in the Outline view. In the Design view, change it to

SimpleType2.

￿Now switch over to the Source view. Notice how all references to SimpleType1 change to SimpleType2 automatically.

The XML Schema editor's referential integrity mechanism is not limited only to name change. The same rule applies when you delete a schema component. For example, if you delete a type, all references to that type will automatically be reset to the default string data type. Whenever such an automatic update occurs, an information message will be displayed in the Task view. You can always invoke the undo action if you want to change your mind.

Chapter 5. Application Developer XML Tools 87

Page 103
Image 103
IBM Version 5 manual Making changes and referential integrity, Pop-up on schema file in the Outline view