moonbitstack/moonxml/event does not have a README file

    Sink

    pub(open) trait Sink {
    fn push(Self, event : Event) -> Unit
    }

    Where events go. The tree builder is one implementation; a caller counting tags or writing rows to a database is another, and it never builds a tree.

    Event

    pub(all) enum Event {
    StartTag(name~ : String, attrs~ : Array[(String, String)], self_closing~ : Bool)
    EndTag(name~ : String)
    Text(text~ : String)
    CData(text~ : String)
    Comment(text~ : String)
    ProcessingInstruction(target~ : String, data~ : String)
    Doctype(text~ : String)
    }

    One event of a document being read: a tag opening, a run of text, a comment. libexpat's second reading of a document, in one type.

    @xml.scan streams these; Document::events reads a finished tree back as the same stream. HTML has no streaming read — WHATWG's tree construction needs to see the tree it is building — so its events describe a tree that already exists.

    Source Files

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io