<docVar> (Single Document Variable)

This element specifies the parameters of a single document variable. A document variable is a storage location for arbitrary customer data in name/value pairs that will be persisted in a given WordprocessingML document. Specifically, this element specifies through its @name and @val attributes the name and value pair for a given document variable.

Note:
<w:docVars>
  <w:docVar w:name="example" w:val="example value" />
</w:docVars>

The <docVar> element defines a single document variable, named example using the @name attribute, and assigned the value example value through the @val attribute. ]

Parent Elements

<docVars>2.15.1.31)

Attributes

Description

<name> (Document Variable Name)

Specifies the name of the parent document variable.

<w:docVars>
  <w:docVar w:name="example name" w:val="example value" />
</w:docVars>

The @name attribute specifies that the name of the document variable is example name. ]

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

<val> (Document Variable Value)

Specifies the value of the parent document variable.

<w:docVars>
  <w:docVar w:name="example name" w:val="Tristan Davis" />
</w:docVars>

The @val attribute specifies that the value of the document variable is Tristan Davis. ]

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

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_DocVar">
	<attribute name="name" type="ST_String" use="required"/>
	<attribute name="val" type="ST_String" use="required"/>
</complexType>