Mixed content

Since Word 2003 is able to display XML data, to process them and to save them as WordML, these data have to be marked in the WordML document.

Such a combination of WordML, which is basically a markup language for the formatting of Word documents, and own XML content is called "mixed content" by Microsoft.

This name is contrary to the term "mixed content" in the SGML/XML world. In this context, mixed content means an element which has or may have textual content as well as child elements.

If WordML documents contain individual XML data, these will be integrated into the WordML document upon saving and can be distinguished from the other elements by a special namespace.

The figure shows an example for a document with mixed content. You can see a XML file which has been opened and partly formatted in Word. Since the formatting as well as the actual XML file must be preserved when saving, a distinction is made between the own XML elements with the own namespace (in this example ns4) and the WordML element.

image - mixed content

Figure: mixed content

     <ns4:EUROPA <!-- en: EUROPE --> >
           <w:pPr><w:ind w:left="360"/></w:pPr>
             <w:ind w:left="720"/>
             <w:rStyle w:val="Heading1Char"/>
             <w:t>Deutschland <!-- Germany --> </w:t>
         <ns4:EINWOHNERZAHL EINHEIT="Millionen" <!-- POPULATION UNIT="Million" --> >

Copyright © dpunkt.verlag GmbH 2007
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "Professionelle XML-Verarbeitung mit Word" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

dpunkt.verlag GmbH, Ringstraße 19B, 69115 Heidelberg, fon 06221-14830, fax 06221-148399, hallo(at)dpunkt.de