HtmlReader

Overview

HtmlReader is a class in Aspose.Cells FOSS for Typescript.

This class provides 9 methods for working with HtmlReader objects in Typescript programs. Available methods include: constructor, getAttribute, getElementsByTagName, getFullElement, getInnerHtml, getOuterHtml, querySelector, querySelectorAll, read. All public members are accessible to any Typescript application after installing the Aspose.Cells FOSS for Typescript package. Properties: isEndTag, isSelfClosing, isStartTag, tagName, text, textContent.

Description

HtmlReader is a class in the Aspose.Cells FOSS library for TypeScript that exposes 8 methods and 6 properties for programmatic use.

Core capabilities include: : string; : boolean; : boolean. These operations enable developers to integrate htmlreader functionality directly into TypeScript applications.

The class also provides the tagName property (gets the tag name), the isStartTag property (gets the is start tag), the isEndTag property (gets the is end tag).

Instances are created through a single constructor that initializes the object with default values.

Properties

NameTypeAccessDescription
tagName: stringReadGets the tag name.
isStartTag: booleanReadGets the is start tag.
isEndTag: booleanReadGets the is end tag.
isSelfClosing: booleanReadGets the is self closing.
text: stringReadGets the text.
textContentstringReadGets the text content.

Methods

SignatureDescription
constructor(html: string)Initializes a new HtmlReader for the given HTML string.
read()booleanAdvances to the next token and returns true if a token was read, false at end of input.
getAttribute(name: string)string | nullReturns the value of the named attribute on the current element, or null if not present.
getOuterHtml()stringReturns the outer html.
getInnerHtml()stringReturns the inner html.
querySelectorAll(selector: string)HtmlReader[]Returns all elements matching the given CSS selector.
querySelector(selector: string)HtmlReader | nullReturns the first element matching the given CSS selector, or null if none found.
getFullElement()stringReturns the full element.
getElementsByTagName(tagName: string)HtmlReader[]Returns all elements with the given tag name.

See Also