Creating Complex XML Types
Complex types allow you define elements with attributes or subelements in your XML Schema. For example, you could define an addressType made up of name, address, and postal code. This new type could then be used by an Address element.
To create a new complexType object
- Add an XML Schema or DataSet to your project. For details, see Adding New Schemas.
- Drag a complexType object from the XML Schema tab of the Toolbox onto the design surface.
- In the edit box in the grid header, select complexType1 and type a new value to rename the object.
- To specify the elements for the complex type, follow these steps:
- In the first empty row in the grid, select the small cell next to the asterisk to access the element type drop-down list box.
- Choose the type of element from the list.
- In the second cell, replace the default name with a name for the element you chose.
- In the third cell, select the type for the element. You can choose an existing type, an unnamed type, or a type you have created.
- Continue adding elements to the complex type until it is fully declared.
To delete an element from a complexType
- Right-click the row you want to delete, and then click Delete on the shortcut menu.
To delete an entire complexType
- Right-click the header of the grid, and then click Delete.