Redefining Types
In this section, you will learn how to redefine a type from one schema in another schema. You will also learn how to add a new element to a redefined type. This is also done in XMLSpy. For the purpose of this tutorial, we will use the schema book_order.xsd as an example.
To redefine the type PersonInfoType:
1.In SchemaAgent Client, right-click book_order.xsd and select Edit in XMLSpy (Ctrl+Y) from the context menu.
Notice that the schema contains a redefine statement, which was automatically added when you connected the two schemas in the Redefine section discussed previously.
2.Select the line that says "end of redefine" and click Insert .
3.Select ComplexType from the menu that pops up and enter "personInfoType" as the name for this type.
4.Click the Display Diagram icon for personInfoType. The content model of personInfoType, as defined in event_registration.xsd, appears.
5.Right-click the complexType, and select Add child | Sequence from the context menu.
6.Right-click the new sequence icon and select Add Child | Element from the context menu.
7.Enter "customerNumber" as the name for this element.
8.In the Details entry helper, select xs:string from the type drop-down list.
9.Save the file.
You have now redefined personInfoType to be used as a type in the XML schema book_order.xsd.