Lists

Lists are a very strange and often hard to handle construction in WordML. For Word 2003 lists are paragraphs with the quality of a list. As otherwise usual in XML structures, they are not bundled with several list bullets in a container and there are no auxiliary attributes and elements with information on their shape and position as with the tabulators.

Lists become particularly problematic if the user tries to transfer WordML fully automatically into other structures.

In general, there are three possibilities to generate lists:

  • Lists may be part of a paragraph style.

  • They may be defined in the list styles and called up via an ID.

  • They may be defined in the list styles. The style contains an ID which is called up by a <w:list> element and receives a new ID. Now, this ID can also serve as a target for the paragraph. Consequently, it may happen that several IDs are used for the same style.

In the following examples the possibilities to generate lists are introduced:

<w:lists>                                                    (1)
   <w:listDef w:listDefId="5">                               (2)
     <w:lsid w:val="42933BEE"/>
     <w:plt w:val="HybridMultilevel"/>
     <w:tmpl w:val="EF0C5E28"/>
     <w:lvl w:ilvl="0" w:tplc="BABAFAFC">                    (3)
       <w:start w:val="1"/>
       <w:pStyle w:val="Normal"/>
       <w:lvlText w:val="%1."/>
       <w:lvlJc w:val="left"/>
       <w:pPr>
         <w:tabs>
           <w:tab w:val="list" w:pos="720"/>
         </w:tabs>
         <w:ind w:left="720" w:hanging="360"/>
       </w:pPr>
     </w:lvl>
     <w:lvl w:ilvl="1" w:tplc="04070019" w:tentative="on">
       <w:start w:val="1"/>
       <w:nfc w:val="4"/>
 ...
<w:p>
   <w:pPr>
     <w:listPr>                                            (4)
       <w:ilfo w:val="5">                                  (5)
       <w:ilvl w:val="0"/>                                 (6)
       <wx:t wx:val="1." wx:wTabBefore="360" wx:wTabAfter="135"/> (7)
     </w:listPr>
   </w:pPr>
   <w:r>
     <w:t>nummerierte Liste</w:t> <!-- en: numbered list -->
   </w:r>
</w:p>

(1) The <w:lists> element is a container element containing all list styles of a WordML document.

(2) The <w:listDef> element contains an ID as value of the w:listDefId attribute. Reference can be made to this ID in order to transform a paragraph into a list bullet.

(3) <w:lvl> determines for a level of the w:ilvl list with its child elements the formatting properties such as numbering, paragraphs and indents (the counting starts with 0).

(4) <w:listPr> is a container element for the assignment of list properties to a paragraph and is therefore a child element of <w:pPr>.

(5) <w:ilfo> refers with the value of the w:val attribute to an ID of a list. In this example, the number corresponds with the value of the w:listDefId attribute in the <w:listDef> element.

(6) The <w:ilvl> element indicates with its w:val attribute the level in which the paragraph can be found within the list. The element corresponds with the <w:lvl> of the referenced list.

(7) <wx:t> contains information about the formatting of the list bullet. The wx:val attribute is especially important since it provides the preceding number for the numbered lists. The element is automatically generated by Word 2003 and not processed when imported.

Often, liste are not referenced directly as in the example above. Instead, list styles with a <w:list> element get a new ID to which a <w:list> element may refer which, in turn, assigns a new ID or refers to a paragraph.

image - sample list

Figure: sample list

("nummerierte Liste" means numbered list, "unnummerierte Liste" means unnumbered list.)

An extension of the above example could be as follows:

<w:lists>                          (1)
   <w:listDef w:listDefId="5">
     <w:lsid w:val="42933BEE"/>
 ...
   <w:list w:ilfo="5">             (1)
     <w:ilst w:val="7"/>           (2)
   </w:list>
   <w:list w:ilfo="7">
     <w:ilst w:val="8"/>
   </w:list>
   <w:list w:ilfo="8">
     <w:ilst w:val="9"/>
   </w:list>
 </w:lists>
 ...
<w:p>
   <w:pPr>
     <w:listPr>
       <w:ilfo w:val="9">         (3)
       <w:ilvl w:val="0"/>
 ...

(1) The <w:list> element refers with the w:ilfo attribute to an ID belonging to a list definition or to a further <w:list> element or its child element <w:ilst>.

(2) <w:ilst> generates a new ID with the help of the w:val attribute.

(3) By using the w:val attribute, <w:ilfo> refers to an ID. In this example it refers to the ID 9. This corresponds to the ID 8 which, in turn, corresponds to the ID 7 which is equivalent to the ID 5 which at last contains the actual list format information.

<< 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