@federicocarboni/saxe
    Preparing search index...

    Interface SaxHandler

    interface SaxHandler {
        comment?(content: string): void;
        doctype?(doctype: Doctype): void;
        endTag(name: string): void;
        entityRef?(name: string): boolean;
        processingInstruction?(target: string, content: string): void;
        startTag(name: string, attributes: Attributes): void;
        text(content: string, isCDataSection: boolean): void;
        xmlDecl?(declaration: XmlDeclaration): void;
    }

    Hierarchy

    • SaxPrologHandler
      • SaxHandler
    Index

    Methods

    • A comment.

      <!-- content -->
      

      Parameters

      • content: string

        Comment content, whitespace is not trimmed or normalized.

      Returns void

    • Document type declaration.

      <!DOCTYPE example PUBLIC "-//Example//example doc" "http://example.org/example.dtd">
      

      This handler is called before parsing any markup declarations.

      Parameters

      Returns void

    • An end tag.

      </element>
      

      Parameters

      • name: string

        Name of the element.

      Returns void

    • A general entity reference in document content for which the parser has no declarations. Undeclared entities in attribute values are always an error.

      <root>
      &entity;
      </root>

      This function is intended to be called only for references to undeclared entities. If the replacement text of entities can be provided, consider using SaxOptions.entityProvider instead so that entities are expanded automatically.

      Parameters

      • name: string

        Name of the entity.

      Returns boolean

      • Returns true if entity name was recognized. If the function is not defined or returns false the parser throws an UndeclaredEntity error.
    • A processing instruction.

      <?target content?>
      

      Parameters

      • target: string

        PI target, used to identify the application to which the instruction is directed.

      • content: string

        PI content, whitespace is not trimmed or normalized.

      Returns void

    • Start tag.

      <element attr="value">
      

      Parameters

      • name: string

        Name of the element.

      • attributes: Attributes

        Attributes of the tag.

      Returns void

    • Text content.

      <element>
      content
      </element>

      By default, the parser collects text content as if it were forming a DOM Text Node. SaxOptions.incompleteTextNodes may be used to emit text events as soon as more data is available.

      Entity references not recognized by the parser are handled in entityRef.

      Parameters

      • content: string

        Text content.

      • isCDataSection: boolean

        Boolean value true if content originated from a CDATA section or false if it is regular text.

      Returns void

    • XML declaration of the document.

      <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
      

      Parameters

      Returns void