XML - Element Content
An element with no content is said to be empty. The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag.
Examples of empty elements:
<IMG align="left" src="http://www.w3.org/Icons/WWW/w3c_home" /> <br></br> <br/>
An element has mixed content when elements of that type contain:
- optionally interspersed with child elements.
Text and elements can be freely intermixed in a DOM hierarchy. That kind of structure is called mixed content in the DOM model.
Mixed content occurs frequently in documents. For example, suppose you wanted to represent this structure:
<sentence>This is an <bold>important</bold> idea.</sentence>
The hierarchy of DOM nodes would look something like this, where each line represents one node:
ELEMENT: sentence + TEXT: This is an + ELEMENT: bold + TEXT: important + TEXT: idea.
It is the intermixing of text and elements that defines the mixed-content model.
Not Mixed (CDATA)
An element has a not mixed content when elements of that type contain only character data.