@maschinenlesbar.org/openka-cli
    Preparing search index...

    Function streamElements

    • Stream the top-level <tag>…</tag> fragments out of a large document.

      The Wahlperiode exports are tens of megabytes with tens of thousands of sibling records; parsing the whole file into one tree would work but would hold every record in memory at once for no benefit. This yields one parsed element at a time. The tag must not nest inside itself, which holds for the export formats.

      Parameters

      • source: string
      • tag: string

      Returns Generator<XmlNode>