[#nlohmann-basic_json-0c-sax_parse-0e] = xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0c.adoc[basic_json]::sax_parse :relfileprefix: ../../ :mrdocs: generate SAX events (iterator pair, or iterator+sentinel pair for C++20 ranges support) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class IteratorType, class SAX, class SentinelType = IteratorType> requires detail::can_compare_ne<IteratorType, SentinelType>::value static bool sax_parse( IteratorType first, SentinelType last, SAX* sax, xref:nlohmann/basic_json-0c/input_format_t.adoc[input_format_t] format = input_format_t::json, bool const strict = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- == Return Value whether the generation of SAX events completed successfully == Parameters [cols="1,4"] |=== | Name| Description | *first* | iterator to the start of the input | *last* | iterator to the end of the input, or a sentinel value comparable to _first_ | *sax* | SAX event consumer | *format* | the format to parse the input as | *strict* | whether to expect the input to be consumed until EOF | *ignore_comments* | whether comments should be ignored and treated like whitespace (`true`) or yield a parse error (`false`); only applies to the `json` format | *ignore_trailing_commas* | whether trailing commas in arrays and objects should be ignored (`true`) or yield a parse error (`false`); only applies to the `json` format |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#