May 28, 2021 XML Schema
Text-only composite elements can contain text and properties.
This type contains only simple content (text and properties), so we'll add a simpleContent element to this content. When using simple content, we have to define extensions or qualifications within the simpleContent element, like this:
Tip: Use the extension or restriction element to extend or limit the basic simple type of the element. Here's an example of an XML element, "shoesize," that contains only text:
The following example declares a composite type whose contents are defined as integer values, and the "shoesize" element contains a property named "country":
We can also set a name for the complexType element and have the type property of the "shoesize" element refer to the name (by using this method, several elements can refer to the same composite type):
XML Schema composite element types can also contain both properties, elements, and text, i.e., composite elements that blend content types, which you can refer to in the next section for more information.