The root element

The root element has a number of attributes and namespace declarations. Apart from the namespace declaration for WordML, all remaining namespace declarations are optional and could be omitted, if no further namespace has been used.

If the document has mixed content, i.e. Word has been used as XML editor and XML data have been saved within the WordML document, the proprietary declaration (URI and namespace) is to be indicated here.

The prefixes provided in this example, such as "w" for WordML, are freely selectable according to the XML rules, but should nevertheless be adopted in this form. In many cases, Word 2003 reacts in a rather unconventional way and therefore internal Word rules should not be violated.

The following code shows the <w:wordDocument> root element with the indications to the namespaces:

<w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve">
 

The namespaces have the following meanings:

  • xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"

    By using the prefix w, the namespace declares the WordML elements and attributes. The name of the underlying schema is wordnet.xsd. You can find all schemas in the WordML documentation (Microsoft Office 2003 XML Reference Schemas).

  • xmlns:v="urn:schemas-microsoft-com:vml"

    By using the prefix v, the namespace declares the VML elements and attributes which are used to embed graphics. Unfortunately, the accompanying schema is not part of the reference package.

  • xmlns:w10="urn:schemas-microsoft-com:office:word"

    By using the prefix w10, the namespace declares the elements and attributes for the positioning of graphics. The name of the underlying schema is w10.xsd.

  • xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core"

    By using the prefix sl, the namespace declares those two elements and those three attributes used for the embedding of own schemas. The name of the underlying schema is xsdlib.xsd.

  • xmlns:aml="http://schemas.microsoft.com/aml/2001/core"

    By using the prefix aml, the namespace declares the elements and attributes used for the change tracking, commentation and the generation of links. The name of the underlying schema is aml.xsd.

  • xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"

    By using the prefix wx, the namespace declares the elements and attributes which serve as hints for the convertion of the document into other formats such as HTML. The elements are not analysed in Word itself. The name of the underlying schema is wordnetaux.xsd.

  • xmlns:o="urn:schemas-microsoft-com:office:office"

    By using the prefix o, the namespace declares the elements and attributes which provide further details on the file. The elements contain information on the author, the last date of saving, the date of creation, etc. This schema is also used in Excel. The name of the underlying schema is office.xsd.

  • xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"

    By using the prefix dt, the namespace declares an attribute which determines the data type of a value. The name of the underlying schema is dt.xsd and it can be found in the folder for Excel schemas.

<< back next >>

 


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