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.
Notice that the schema contains a redefine statement, which was automatically added when you connected the two schemas in the Redefine section discussed previously.
To redefine the type PersonInfoType:
|2.||Select the line that says "end of redefine" and click the Insert icon.|
|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.
© 2019 Altova GmbH