Including Types

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  SchemaAgent Tutorial > Using XMLSpy as a SchemaAgent Client >

Including Types

In this section, you will learn how the elements of an included schema are actually used in the target schema. To this aim, you have to open and edit the target schema, for example dvd_order.xsd, in XMLSpy.

spy_schema-overview-dvd

Notice that the schema contains an include statement, which was automatically added when you connected the two schemas in the Include section discussed previously. The global complex types that you have created in the previous section of the tutorial are now available in dvd_order.xsd.

 

 

To include personInfoType and creditCardInfoType in dvd_order.xsd:

1.Open dvd_order.xsd in XMLSpy.
2.In XMLSpy, click the Display Diagram ic_component icon for the element dvd_order to display its content model.

dvd_order_content_model

3.Right-click the sequence element and select Add child | Element.

spy_add-child-element

4.Enter "customerInfo" as the name for this element.
5.With this element still selected, in the Details entry helper, select personInfoType from the type drop-down list. Components that are part of a relation between the two schemas are in black, all others are in blue.

spy_details-customerInfo

6.Right-click on the sequence element and select Add child | Element.
7.Enter "creditCardInfo" as the name for this element.
8.With this element still selected, in the Details entry helper, select creditCardInfoType from the type drop-down list.
9.Save the file.

 

You have now included two types from the schema event_registration.xsd in the schema dvd_order.xsd.

including_a_type


© 2019 Altova GmbH