[#nlohmann-basic_json-0c-sax_parse-08]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0c.adoc[basic&lowbar;json]::sax&lowbar;parse
:relfileprefix: ../../
:mrdocs:

generate SAX events

== Synopsis

Declared in `&lt;nlohmann&sol;json&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename InputType,
    typename SAX&gt;
static
bool
sax&lowbar;parse(
    InputType&& i,
    SAX* sax,
    xref:nlohmann/basic_json-0c/input_format_t.adoc[input&lowbar;format&lowbar;t] format = input&lowbar;format&lowbar;t&colon;&colon;json,
    bool const strict = true,
    bool const ignore&lowbar;comments = false,
    bool const ignore&lowbar;trailing&lowbar;commas = false);
----

== Return Value

whether the generation of SAX events completed successfully

== Parameters

[cols="1,4"]
|===
| Name| Description
| *i*
| input to read the JSON value from
| *sax*
| SAX event consumer
| *format*
| the format to parse the input as
| *strict*
| whether to expect the input to be consumed until EOF
| *ignore&lowbar;comments*
| whether comments should be ignored and treated like whitespace (`true`) or yield a parse error (`false`)&semi; only applies to the `json` format
| *ignore&lowbar;trailing&lowbar;commas*
| whether trailing commas in arrays and objects should be ignored (`true`) or yield a parse error (`false`)&semi; only applies to the `json` format
|===


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