The best XML Schema complex empty element Tutorial In 2024, In this tutorial you can learn Composite empty elements:,
Empty the contents of the composite elements can not contain only contain attributes.
An empty XML element:
The above "product" no element content. To define no content type, we must declare a type can contain only elements in its content, but in fact we do not declare any element, like this:
In the above example, we define a complex type with complex content. ComplexContent element gives the signal that we intend to define or expand the content model of a complex type, and integer defining a property is declared but does not introduce any element content.
However, this statement can be more compact "product" elements:
Or you can give a name to a complexType element, and then set a type attribute "product" and refer to this complexType element name (by using this method, several elements can refer to the same complex type):