XmlEventCallbacks
import { XmlEventCallbacks } from "jsr:@ende/xml";interface
interface XmlEventCallbacksCallbacks for event-level output - enables zero-allocation event emission.
The parser invokes these callbacks instead of creating event objects.
reference
XmlEventCallbacksProperties
onDeclaration
onDeclaration?: XmlDeclarationCallbackCalled for XML declarations.
onDoctype
onDoctype?: XmlDoctypeCallbackCalled for DOCTYPE declarations.
Only invoked when the BaseParseOptions.disallowDoctype
option is set to false; with the default (true), a DOCTYPE
declaration throws an XmlSyntaxError instead.
onText
onText?: XmlContentCallbackCalled for text content (entity-decoded).
onCData
onCData?: XmlContentCallbackCalled for CDATA sections.
onComment
onComment?: XmlContentCallbackCalled for comments.
onProcessingInstruction
onProcessingInstruction?: XmlProcessingInstructionCallbackCalled for processing instructions.
Methods
onStartElement
onStartElement?(name: string, colonIndex: number, uri: string | undefined, attributes: XmlAttributeIterator, selfClosing: boolean, line: number, column: number, offset: number): voidCalled when an element starts.
name: stringcolonIndex: numberIndex of ':' in name, or -1 if no prefix.
uri: string | undefinedThe resolved namespace URI if the element has a bound prefix, undefined otherwise.
attributes: XmlAttributeIteratorselfClosing: booleanline: numbercolumn: numberoffset: number
onEndElement
onEndElement?(name: string, colonIndex: number, uri: string | undefined, line: number, column: number, offset: number): voidCalled when an element ends.
name: stringcolonIndex: numberIndex of ':' in name, or -1 if no prefix.
uri: string | undefinedThe resolved namespace URI if the element has a bound prefix, undefined otherwise.
line: numbercolumn: numberoffset: number