DivsChild class

Office 2013 and later

Child div Elements Contained within Current div. When the object is serialized out as xml, its qualified name is w:divsChild.

Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public class DivsChild : DivsType

[ISO/IEC 29500-1 1st Edition]

divsChild (Child div Elements Contained within Current div)

This element specifies the set of HTML div or blockquote elements which are contained within the current HTML div, body, or blockquote element, establishing the parent/child hierarchy of the original set of these elements.

When an HTML document containing these objects is saved in the WordprocessingML format, WordprocessingML objects store a reference to their most immediate parent div, body, or blockquote element using the divId element.

However, since only a single reference is stored, this information is often insufficient to determine the appropriate parent/child hierarchy for the original HTML div data, so it can be applied appropriately. This element allows that hierarchy to be stored, as child HTML div elements are stored within the childDivs element.

[Example: Consider a simple HTML document defined as follows:

<html>
  <body>
    <div style=" margin-top:50px">
      <p>Paragraph one.</p>
      <div style="margin-left:50px">
        <p>Paragraph two.</p>
      </div>
    </div>
  </body>
</html>

If the outer and inner body and div elements were assigned id attributes of 1626542603 and 313534916 respectively, then the first paragraph would reference the div ID of the outer div (since it is contained within that HTML div element) and the second paragraph would reference the div ID of the inner div (since it is contained within the child HTML div element), as follows:

<w:p>
  <w:pPr>
    <w:divId w:val="1626542603" />
  </w:pPr>
  <w:r>
    <w:t>Paragraph one.</w:t>
  </w:r>
</w:p>
<w:p>
  <w:pPr>
    <w:divId w:val="313534916" />
  </w:pPr>
  <w:r>
    <w:t>Paragraph one.</w:t>
  </w:r>
</w:p>

However, this information alone is insufficient - it is unclear if the second div is contained within, or simply adjacent to, the first one.

In order to preserve this information, the correct hierarchy is stored within the web settings part:

<w:divs>
  <w:div w:id="1626542603">
    …    <w:divsChild>
      <w:div w:id="313534916">
        …      </w:div>
    </w:divsChild>
  </w:div>
</w:divs>

The divsChild element contains the second div as a child of the first div, specifying that the first div covers both paragraphs. end example]

Parent Elements

div (§17.15.2.6)

Child Elements

Subclause

div (Information About Single HTML div Element)

§17.15.2.6

[Note: The W3C XML Schema definition of this element’s content model (CT_Divs) is located in §A.1. end note]

© ISO/IEC29500: 2008.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: