1. A tangible computer-readable storage medium having encoded thereon data representing a model of a document, the document model comprising: a one-dimensional character string that includes characters of the document in an order in which they appear in the document; a map of styles that includes markers that correspond to changes in styles in the document, and pointers to the character string, wherein the pointers define locations along the character string at which the changes in styles are to occur and define style runs between matched markers; and one or more external references to objects outside the document model, the external references including identifiers for the objects and pointers to the character string indicating where in the character string the object will appear.