Options
All
  • Public
  • Public/Protected
  • All
Menu

Contains methods to parse html and xml string into Document instances. The browser's default DOMParser returns a Document regardless if the source string is valid or not. The methods in this class detects for parsing errors and throws exceptions if any parsing error occurs.

Hierarchy

  • IDomParser

Implemented by

Index

Methods

parseHtmlString

  • parseHtmlString(str: string, path: string): HTMLDocument
  • Parses the string as an HTML Document

    throws

    CoreXmlError with type "DOM_PARSE_ERROR" if the string is invalid HTML

    Parameters

    • str: string

      The HTML string to parse as a Document.

    • path: string

      The path to the file. Used for error reporting.

    Returns HTMLDocument

parseXhtmlString

  • parseXhtmlString(str: string, path: string): HTMLDocument
  • Parses the string as an XHTML Document

    throws

    CoreXmlError with type "DOM_PARSE_ERROR" if the string is invalid XHTML

    Parameters

    • str: string

      The XHTML string to parse as a Document.

    • path: string

      The path to the file. Used for error reporting.

    Returns HTMLDocument

parseXmlString

  • parseXmlString(str: string, path: string): XMLDocument
  • Parses the string as an XML Document

    throws

    CoreXmlError with type "DOM_PARSE_ERROR" if the string is invalid XML

    Parameters

    • str: string

      The XML string to parse as a Document.

    • path: string

      The path to the file. Used for error reporting.

    Returns XMLDocument

Generated using TypeDoc