xml spy
Previous  Top  Next

Using Redefined Types


In the previous section, you redefined schema event_registration.xsd in schema book_order.xsd by adding a customer number to the complex type personInfoType. In this section, you will learn how to use this redefined complex type in schema book_order.xsd.

 

spy_schema-overview-book-extended

 

To use a redefined type in the target schema:

 

1.In the schema overview for book_order.xsd, click the Display Diagram ic_component icon of the root element book_order.

 

book_order_content_model

 

2.Right-click the sequence element and select Add child | Element from the context menu.

 

spy_add-child-element-book

 

3.Enter "customerInfo" as the name for this element.

 

4.With this element still selected, in the Details entry helper, select personInfoType from the type drop-down list. Components from both schemas are in black, all others are in blue.

 

spy_details-customerInfo

 

The redefined type is now being used as the type of an element in book_order.xsd.

 

book_order_content_model2

 

Using types without redefinition

 

Within a redefine relationship, you can also use types from the source schema without redefining them in the target schema.

 

To use a type in the target schema as is:

 

1.In the display diagram for the element book_order, right-click on the sequence element and select Add child | Element from the context menu.

 

2.Enter "creditCardInfo" as the name for this element.

 

3.With this element still selected, in the Details entry helper, select creditCardInfoType from the type drop-down list.

 

4.Save the file.

 

The type creditCardInfoType is now being used as the type of an element in book_order.xsd.

 

book_order_content_model3


Previous  Top  Next

© 2008 Altova