∟Declaring Complex Elements with Attributes, Sub Elements & Text Content
This section describes a tutorial example on how to declare an element that accepts attributes and sub (child) element mixed with text content using a user defined complexType datatype.
A complex element with text content, sub elements, and attributes
can be declared with a "complexType" datatype with "complexContent mixed="true"" containing some "element"s
and some "attribute"s.
A good example of complex elements with attributes only is the <form> element in HTML documents.
It accepts attributes like "action", sub elements like <input>, and text contents.
Rule 1. The "mixed="true"" attribute inside "complexContent" allows text content to be mixed in the element.
This rule should be used with other rules described in previous sections to define a complex element with text content, sub elements, and attributes.
Here is a sample schema, complexType_everything.xsd, that defines <form> to accept sub elements
attributes, and text content: