[#BloombergLP-balxml-Formatter-addElementAndData]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/Formatter.adoc[Formatter]::addElementAndData
:relfileprefix: ../../../
:mrdocs:

Add an element of the specified `name` containing the specified `value`&period;

== Synopsis

Declared in `&lt;balxml&lowbar;formatter&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
void
addElementAndData(
    std::string&lowbar;view const& name,
    TYPE const& value,
    int formattingMode = 0);
----

== Description

This has the same effect as calling the following sequence&colon; `openElement(name)&semi; addData(value), closeElement(name)&semi;`&period; Optionally specify the `formattingMode`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *name*
| name of the element
| *value*
| data content of the element
| *formattingMode*
| mode used to format `value`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
