Type alias ParserOptions

ParserOptions: {
    ignoreUndefinedEntities?: boolean;
    includeOffsets?: boolean;
    preserveCdata?: boolean;
    preserveComments?: boolean;
    preserveDocumentType?: boolean;
    preserveXmlDeclaration?: boolean;
    resolveUndefinedEntity?: ((entity: string) => string | null | undefined);
    sortAttributes?: boolean;
}

Type declaration

  • Optional ignoreUndefinedEntities?: boolean

    When true, an undefined named entity (like "&bogus;") will be left in the output as is instead of causing a parse error.

    Default

    false

  • Optional includeOffsets?: boolean

    When true, the starting and ending byte offsets of each node in the input string will be made available via start and end properties on the node.

    Default

    false

  • Optional preserveCdata?: boolean

    When true, CDATA sections will be preserved in the document as XmlCdata nodes. Otherwise CDATA sections will be represented as XmlText nodes, which keeps the node tree simpler and easier to work with.

    Default

    false

  • Optional preserveComments?: boolean

    When true, comments will be preserved in the document as XmlComment nodes. Otherwise comments will not be included in the node tree.

    Default

    false

  • Optional preserveDocumentType?: boolean

    When true, a document type declaration (if present) will be preserved in the document as an XmlDocumentType node. Otherwise the declaration will not be included in the node tree.

    Note that when this is true and a document type declaration is present, the DTD will precede the root node in the node tree (normally the root node would be first).

    Default

    false

  • Optional preserveXmlDeclaration?: boolean

    When true, an XML declaration (if present) will be preserved in the document as an XmlDeclaration node. Otherwise the declaration will not be included in the node tree.

    Note that when this is true and an XML declaration is present, the XML declaration will be the first child of the document (normally the root node would be first).

    Default

    false

  • Optional resolveUndefinedEntity?: ((entity: string) => string | null | undefined)
      • (entity: string): string | null | undefined
      • When an undefined named entity is encountered, this function will be called with the entity as its only argument. It should return a string value with which to replace the entity, or null or undefined to treat the entity as undefined (which may result in a parse error depending on the value of ignoreUndefinedEntities).

        Parameters

        • entity: string

        Returns string | null | undefined

  • Optional sortAttributes?: boolean

    When true, attributes in an element's attributes object will be sorted in alphanumeric order by name. Otherwise they'll retain their original order as found in the XML.

    Default

    false

Generated using TypeDoc