Behavior Class

Entry Insertion Behavior.When the object is serialized out as xml, its qualified name is w:behavior.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlLeafElement
      DocumentFormat.OpenXml.Wordprocessing.Behavior

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

Syntax

'Declaration
Public Class Behavior _
    Inherits OpenXmlLeafElement
'Usage
Dim instance As Behavior
public class Behavior : OpenXmlLeafElement

Remarks

[ISO/IEC 29500-1 1st Edition]

17.12.1 behavior (Entry Insertion Behavior)

This element specifies a single behavior which shall be applied to the contents of the parent glossary document entry (§17.12.5) when it is added to the main document story of a WordprocessingML document. These behaviors shall be used to format the surrounding WordprocessingML around insertion, and do not require the presence of a user interface (i.e. applications without a user interface shall also utilize these settings).

[Example: Consider the WordprocessingML fragment for a glossary document entry containing a single run, defined as follows:

<w:docPart>
<w:docPartPr>
<w:behaviors>
<w:behavior w:val="p"/>
</w:behaviors>
…
</w:docPartPr>
<w:docPartBody>
<w:p>
<w:r>
<w:t>Sample entry.</w:t>
</w:r>
</w:p>
</w:docPartBody>
</w:docPart>

The behavior element has a value of p, which specifies that the contents of the parent glossary document entry must be inserted in their own paragraph when they are added to the contents of a document. If the document content to which they are added is defined as follows (and the part is added between the two text runs):

<w:body>
<w:p>
<w:r>
<w:t>After this text</w:t>
</w:r>
<w:r>
<w:t>Before this text</w:t>
</w:r>
</w:p>
</w:body>

This setting specifies that although the part would normally be inserted between the two existing runs in the paragraph, that behavior must ensure that the part is inserted into its own paragraph, resulting in the following WordprocessingML:

<w:body>
<w:p>
<w:r>
<w:t>After this text</w:t>
</w:r>
</w:p>
<w:p>
<w:r>
<w:t>Sample entry.</w:t>
</w:r>
</w:p>
<w:p>
<w:r>
<w:t>Before this text</w:t>
</w:r>
</w:p>
</w:body>

end example]

Parent Elements

behaviors (§17.12.2)

Attributes

Description

val (Insertion Behavior Value)

Specifies the insertion behavior which shall be associated with the current glossary document entry.

[Example: Consider the WordprocessingML fragment for a glossary document entry's properties, defined as follows:

<w:docPartPr>
<w:behaviors>
<w:behavior w:val="content"/>
</w:behaviors>
</w:docPartPr>

The val attribute value of content specifies that the insertion of this glossary document entry must include only the content (the last paragraph in the part must be merged into the current paragraph in the document). end example]

The possible values for this attribute are defined by the ST_DocPartBehavior simple type (§17.18.15).

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

© ISO/IEC29500: 2008.

Thread Safety

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

See Also

Reference

Behavior Members

DocumentFormat.OpenXml.Wordprocessing Namespace