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
| Name | Type | Access | Description |
|---|---|---|---|
tagName | : string | Read | Gets the tag name. |
isStartTag | : boolean | Read | Gets the is start tag. |
isEndTag | : boolean | Read | Gets the is end tag. |
isSelfClosing | : boolean | Read | Gets the is self closing. |
text | : string | Read | Gets the text. |
textContent | string | Read | Gets the text content. |
Methods
| Signature | Description |
|---|---|
constructor(html: string) | Initializes a new HtmlReader for the given HTML string. |
read() → boolean | Advances to the next token and returns true if a token was read, false at end of input. |
getAttribute(name: string) → string | null | Returns the value of the named attribute on the current element, or null if not present. |
getOuterHtml() → string | Returns the outer html. |
getInnerHtml() → string | Returns the inner html. |
querySelectorAll(selector: string) → HtmlReader[] | Returns all elements matching the given CSS selector. |
querySelector(selector: string) → HtmlReader | null | Returns the first element matching the given CSS selector, or null if none found. |
getFullElement() → string | Returns the full element. |
getElementsByTagName(tagName: string) → HtmlReader[] | Returns all elements with the given tag name. |