Constructor
(abstract) new Node()
Classes
Members
(readonly) document
- Description:
- Find the Document that this node is in, if it is in a Document.
- Source:
Find the Document that this node is in, if it is in a Document.
(nullable) parent :Node
Type:
Methods
first(pattern, contextopt) → {string|Node|number|null}
- Description:
- Get the first matching node for a given pattern, or null if none exist.
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pattern |
string | XPath | The pattern to match | ||
context |
Node |
<optional> |
this
|
The context node. Uses this node as context if none is provided. |
Returns:
The first match if one exists
- Type
- string | Node | number | null
get(pattern, contextopt) → {XPathResult}
- Description:
- Get all of the nodes that match the given XPath pattern, with the given context for XPath execution.
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pattern |
string | XPath | The pattern to match | ||
context |
Node |
<optional> |
this
|
The context node. Uses this node as context if none is provided. |
Returns:
The matching nodes
- Type
- XPathResult
(abstract) text(newTextopt) → {string|Node}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
newText |
string |
<optional> |
New text to insert |
Returns:
The concatenated text
- Type
- string | Node
(abstract) toString(optionsopt) → {string}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
MaybeStylizedSeparated |
<optional> |
How to convert to string |
Returns:
The node, converted to a string
- Type
- string
(static) escape(str, attribopt) → {string}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
str |
string | The string to escape | ||
attrib |
boolean |
<optional> |
false
|
Is the string an attribute value? (if so, double-quotes are escaped) |
Returns:
The escaped string
- Type
- string