Please enable JavaScript to view this site.

Altova SchemaAgent 2021

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.

sa_tutorial_redefine1

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 ic_schem_ins.

3.Select ComplexType from the menu that pops up and enter "personInfoType" as the name for this type.

sa_tutorial_redefine2

4.Click the Display Diagram ic_component icon for personInfoType. The content model of personInfoType, as defined in event_registration.xsd, appears.

spy_content-model-personInfoType

5.Right-click the personInfoType2 complexType, and select Add child | Sequence from the context menu.

spy_add-child-sequence

6.Right-click the new sequence icon and select Add Child | Element from the context menu.

spy_add-child-sequence-element

7.Enter "customerNumber" as the name for this element.

8.In the Details entry helper, select xs:string from the type drop-down list.

sa_tutorial_redefine6

9.Save the file.

 

You have now redefined personInfoType to be used as a type in the XML schema book_order.xsd.

 

spy_content-model-personInfoType-redefined

© 2015-2021 Altova GmbH