Adding a Compositor to an XML Schema File
See Also
A compositor defines how a list of child elements within an element in an instance document should be treated. There are three types of compositors: sequence, choice, and all.
- sequence compositor. This compositor specifies that the child elements must appear in a specific order. The minOccurs attribute defines how many times a child element can occur. An instance document that displays the child elements in a different order from the one defined in the sequence would be invalid. If the minOccurs attribute of the sequence compositor is 0 (zero), and an instance document displays child elements in the same order but does not display all the child elements defined in the sequence, it would still be valid.
You can add a sequence compositor to the following schema components: group, choice, sequence, complexType, restriction, and extension.
- choice compositor. This compositor allows any one of the child elements contained in the compositor declaration to be present within the containing element in the instance document.
You can add a choice compositor to the following schema components: group, choice, sequence, complexType, restriction, and extension.
- all compositor. This compositor specifies that any of the child elements can appear in any order in the instance document.
You can add an all compositor to the following schema components: group, complexType, restriction, and extension.
To add a compositor:
- In the IDE, open the schema file where you want to add the compositor.
- In the Schema view, right-click the node of the schema component where you want to add the compositor component and choose Add > compositor from the pop-up menu.
- If the compositor you want to add does not appear in the pop-up menu, it means that you cannot add a compositor to the schema component you selected.
The IDE adds a compositor node to the Schema view.
- You can change a compositor in the Design view by double-clicking the compositor (Sequence, Choice, or All) and selecting a different value from the drop-down list that opens.
- See Also
- Adding a group Component to an XML Schema File
- Adding a Global complexType Component to an XML Schema File
- Adding a Local complexType Component to an XML Schema File
- About XML Schema Tools
Legal Notices