Mixed Content

In XML, you can either control the order that child elements of some element appear in (this is called element content), or you can say that an element contains both other elements and text (called mixed content).

To make this more obvious, consider the HTML DL element, which can really only contain DT and DD elements, and you have to have a DT before each DD; this is an example of element content. On the other hand, HTML's P element can contain ordinary text mixed up with all sorts of other elements, such as A, B, I, and IMG, in any old order.

In XML, if you're going to do mixed content, that's fine, but you can't control what order the child elements, mixed in among the text, appear in. This is based on years of experience with SGML, which allows (while discouraging) such control.

Back-link to spec

Copyright © 1998, Tim Bray. All rights reserved.