[#BloombergLP-balxml-Formatter_PrettyImplUtil-openElement]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/Formatter_PrettyImplUtil.adoc[Formatter&lowbar;PrettyImplUtil]::openElement
:relfileprefix: ../../../
:mrdocs:

Open an element of the specified `name`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
std::ostream&
openElement(
    std::ostream& stream,
    xref:BloombergLP/balxml/Formatter_PrettyImplUtil/State.adoc[State]* state,
    std::string&lowbar;view const& name,
    xref:BloombergLP/balxml/FormatterWhitespaceType/Enum.adoc[WhitespaceType::Enum] whitespaceMode = WhitespaceType&colon;&colon;e&lowbar;PRESERVE&lowbar;WHITESPACE);
----

== Description

Open an element of the specified `name` at current indent level with the optionally specified whitespace constraint `whitespaceMode` for its textual data to the specified `stream`, with formatting depending on the specified `state`, and update `state` accordingly, incrementing the indent level&period; Return the `stream`&period; `whitespaceMode` constrains how textual data is written with `addListData` for the current element, but not its nested elements&period; The behavior is undefined if `openElement` is called after the root element is closed and there is no subsequent call to `reset`&period;

== Return Value

a reference to the modifiable `stream`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *stream*
| output stream to write to
| *state*
| formatter state to update
| *name*
| name of the element to open
| *whitespaceMode*
| whitespace constraint for the element&apos;s data
|===


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