MCPcopy Create free account
hub / github.com/denoland/std / parseXmlStream

Function parseXmlStream

xml/parse_stream.ts:62–74  ·  view source on GitHub ↗
(
  source: AsyncIterable<string>,
  callbacks: XmlEventCallbacks,
  options: ParseStreamOptions = {},
)

Source from the content-addressed store, hash-verified

60 * @returns A promise that resolves when parsing is complete.
61 */
62export async function parseXmlStream(
63 source: AsyncIterable<string>,
64 callbacks: XmlEventCallbacks,
65 options: ParseStreamOptions = {},
66): Promise<void> {
67 const { tokenizer, parser } = createXmlPipeline(options, callbacks);
68
69 for await (const chunk of source) {
70 tokenizer.process(chunk, parser);
71 }
72 tokenizer.finalize(parser);
73 parser.finalize();
74}
75
76/**
77 * Parse XML from a byte stream with maximum throughput using direct callbacks.

Callers 2

parseXmlStreamFromBytesFunction · 0.85

Calls 3

createXmlPipelineFunction · 0.90
processMethod · 0.80
finalizeMethod · 0.45

Tested by

no test coverage detected