Interface: XmlParseLimits
Defined in: netconf/src/xml/parse.ts:14
Limits on a parsed document, checked in one linear pass over the text before any of its tree is built. A document over a limit is rejected with an XmlError at the cost of reading its text, so the limits bound the memory a hostile or broken peer can make a parse use.
Extended by
Properties
maxDepth?
readonly maxDepth?: number;Defined in: netconf/src/xml/parse.ts:16
Maximum element nesting depth. Default 256; at most MAX_PARSE_DEPTH.
maxNodes?
readonly maxNodes?: number;Defined in: netconf/src/xml/parse.ts:29
Maximum number of nodes: elements, attributes (namespace declarations included), text runs, comments, processing instructions and CDATA sections. Default 1,000,000.
Parsing builds the element tree in one pass, and costs roughly 0.1–0.3 KB of heap per node at its peak (about 7–8 times the size of a large reply's text): up to about 300 MB at the default, or about 330 MB for the worst shape, where every element declares a namespace. A declaration costs the same however many others are in scope. Raise it for very large replies only with the heap to match.